以前的笔记或摘录:在TEmbeddedWB中使用自己的右键菜单
来源:互联网 发布:sql exists的含义 编辑:程序博客网 时间:2024/05/21 11:26
uses
MSHTML;
function TForm1.WebBrowser1ShowContextMenu(const dwID: Cardinal;
const ppt: PPoint; const pcmdtReserved: IInterface;
const pdispReserved: IDispatch): HRESULT;
var
myHTMLWindow2: IHTMLWindow2;
oHTMLEvent: IHTMLEventObj;
oHTMLDoc2: IHTMLDocument2;
begin
//next block gives access to the event object fired when the user
//right-clicks inside the webBrowser control
oHTMLDoc2 := EmbeddedWB1.Document as IHTMLDocument2; //interface to the displayed doc
myHTMLWindow2 := oHTMLDoc2.parentWindow;
//interface to the window that handles the events
oHTMLEvent := myHTMLWindow2.event; //HERE is the event object
if oHTMLEvent.ctrlKey = system.False then
begin //if the Ctrl key is NOT pressed during right-click..
oHTMLEvent.returnValue := False; //...kills the default pop-up of IE
Result := 0;
//open my PopUp nemu at the absolute X and Y coordinates of the mouse
PopupMenu1.Popup(Mouse.CursorPos.X, Mouse.CursorPos.Y);
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
EmbeddedWB1.Navigate('www.swissdelphicenter.com');
end;
- 以前的笔记或摘录:在TEmbeddedWB中使用自己的右键菜单
- 以前的笔记或摘录:WebBrowser中显示源代码
- 以前的笔记或摘录:delphi IDE的快捷键
- 以前的笔记或摘录:delphi关闭XP防火墙
- 以前的笔记或摘录:idsmpt身份认证相关
- 以前的笔记或摘录: 存储网页为HTM
- 以前的笔记或摘录:存储网页为JPG
- 以前的笔记或摘录:保存网页中的所有图片
- 怎样在CRichEditCtrl控件中加入自己的右键菜单?
- 在windows右键菜单中加入自己的程序
- 以前的笔记或摘录:通过Shellexecute发送带附件的邮件
- 以前的笔记或摘录:Get Listbox Items from a TWebBrowser Document?
- 在网页中自己创建右键菜单
- 修复迅雷在 IE 等浏览器中右键菜单丢失或失效的问题
- 在资源管理器右键菜单中添加新的菜单项
- 在资源管理器右键菜单中添加新的菜单项
- 关联自己的应用程序到右键菜单中
- Windows右键菜单中添加自己的命令
- V$SESSION_LONGOPS
- 以前的笔记或摘录:Get Listbox Items from a TWebBrowser Document?
- SD2C大会流水帐
- 群联量产
- 用document.domain解决Ajax跨子域
- 以前的笔记或摘录:在TEmbeddedWB中使用自己的右键菜单
- typedef和typename关键字
- resin专业版性能调优总结
- 以前的笔记或摘录: 存储网页为HTM
- web services 中资源文件的路径问题
- 从数据库中存取图片
- 简化安全管理选择SIM
- 以前的笔记或摘录:存储网页为JPG
- C.A.R. Hoare