Author: Peter Below
I need to create an invisible window over a webbrowser component so that I can stop
mouse clicks.
Answer:
There are much better ways to block mouse clicks to a specific window. You can use
a handler for the Application.OnMessage event, for example:
1 procedure TMainform.FormCreate(Sender: TObject);
2 begin3 Application.OnMessage := AppOnMessage;
4 end;
5 6 procedure TMainform.AppOnMessage(var Msg: TMsg; var Handled: Boolean);
7 begin8 case Msg.messageof9 WM_MOUSEFIRST..WM_MOUSELAST, WM_MOUSEWHEEL:
10 if Msg.hwnd = Webbrowser1.HWND then11 Handled := True;
12 end;
13 end;