Delphi中禁止WebBrowser右键的方法


本文整理自网络,侵删。

 Delphi中禁止WebBrowser右键的方法

uses MSHtml;

//在控件标签additional中找到TApplicationEvents控件,拖到窗体上.在TApplicationEvents的OnMessage事件中加入以下代码:

procedure TForm1.ApplicationEvents1Message(var Msg: tagMSG;
var Handled: Boolean);
begin
if (Msg.message = wm_rbuttondown) or (Msg.message = wm_rbuttonup) or
(msg.message = WM_RBUTTONDBLCLK) then
begin
if IsChild(Webbrowser1.Handle, Msg.hwnd) then
Handled := true;//如果有其他需要处理的,在这里加上你要处理的代码
end;
end;

相关阅读 >>

Delphi 调用外部 dll 中的函数(2. 晚绑定)

Delphi twebbrowser 获取cookie

Delphi tnethttpclient的用法

Delphi中将webbrowser用作网页编辑器

Delphi实现解析百度搜索结果link?url=

Delphi 禁止窗口移动

Delphi实例之一个较复杂的记事本的实现

Delphi 10.x ide界面

wmi远程访问问题解决方法

Delphi xe6 switch元件简繁问题

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...