Wenn du es ohne TApplicationEvents Komponente machen möchtest:
In der private Sektion
Delphi-Quellcode:
private
procedure OnAppMessge(var Msg: tagMSG; var Handled: Boolean);
im OnCreate:
Delphi-Quellcode:
procedure TForm1.FormCreate(Sender: TObject);
begin
Application.OnMessage := OnAppMessge;
end;
und dann:
Delphi-Quellcode:
procedure TForm1.OnAppMessge(var Msg: tagMSG; var Handled: Boolean);
begin
if (Msg.wParam = Ord('N')) and (GetKeyState(VK_CONTROL) < 0) and
(Msg.Message = WM_KEYDOWN) then
begin
Handled := IsChild(Webbrowser1.Handle, Msg.hwnd);
end;
end;