Webbrowser in Delphi is a browser with IE as the kernel. It is too simple, so we recommend that you useEmbedded Web BrowserControl!
Official Website: http://www.bsalsa.com/index.html
The webbrowser mentioned below refers to this control.
To shield webbrowser from the original context menu, it's easy
Function Tform1.embeddedwb1showcontextmenu ( Const Dwid: Cardinal;
Const PPT: Ppoint; Const Pcmdtreserved: iinterface;
Const Pdispreserved: idispatch): hresult;
Begin
Result: = 0 ; // If the returned result is false, the right-click is not displayed.
End ;
If you want to bring up other menus, you only need:
Function tform1.embeddedwb1showcontextmenu ( Const Dwid: Cardinal;
Const PPT: Ppoint; Const Pcmdtreserved: iinterface;
Const Pdispreserved: idispatch): hresult;
VaR PT: tpoint;
Begin
Getcursorpos (PT );
Popupmenu1.popup (Pt. X, Pt. Y); // a custom menu is displayed.
Result: = 0 ;
End;
Next, let's talk about different widgets on the web page, such as hyperlinks and text boxes.