怎样得到IE运行的handle(100分)

  • 主题发起人 主题发起人 ice1
  • 开始时间 开始时间
I

ice1

Unregistered / Unconfirmed
GUEST, unregistred user!
各位大侠:<br>&nbsp; &nbsp; &nbsp; &nbsp;我一运行IE后,鼠标点击右键无效,我想可能是IE一运行就执行了一个程序,将鼠标置为右键无效。<br>这样的程序怎样写。请各位帮一帮我。急!急!!!
 
Findwindow('IEFrame',nil);
 
unit Unit1;<br><br>interface<br><br>uses<br>&nbsp; Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,<br>&nbsp; Dialogs, ComObj, SHDocVw, ActiveX, Registry, StdCtrls;<br><br>type<br>&nbsp; TForm1 = class(TForm)<br>&nbsp; &nbsp; Button1: TButton;<br>&nbsp; &nbsp; procedure Button1Click(Sender: TObject);<br>&nbsp; private<br>&nbsp; &nbsp; appIE : &nbsp;TInternetExplorer &nbsp;;<br>&nbsp; &nbsp; { Private declarations }<br>&nbsp; public<br>&nbsp; &nbsp; { Public declarations }<br>&nbsp; end;<br><br>var<br>&nbsp; Form1: TForm1;<br><br>implementation<br><br>{$R *.dfm}<br><br><br>function IERestrictionsSettings(Key: string; Disabled: Boolean): Boolean;<br>var<br>&nbsp; reg: TRegistry;<br>begin<br>&nbsp; Result := TRUE;<br>&nbsp; Reg := TRegistry.Create;<br>&nbsp; with Reg do try<br>&nbsp; &nbsp; RootKey := HKEY_CURRENT_USER;<br>&nbsp; &nbsp; OpenKey('Software/Policies/Microsoft/Internet Explorer/Restrictions', True);<br>&nbsp; &nbsp; WriteInteger(Key, Integer(Disabled));<br>&nbsp; &nbsp; CloseKey;<br>&nbsp; except<br>&nbsp; &nbsp; Result := FALSE;<br>&nbsp; end;<br>&nbsp; Reg.Free;<br>end;<br><br>procedure TForm1.Button1Click(Sender: TObject);<br>begin<br>// appIE := CreateOLEObject('InternetExplorer.Application') ;<br>&nbsp; &nbsp; appIE := TInternetExplorer.Create(self) ;<br>&nbsp; &nbsp; appIE.Visible := true ;<br>&nbsp; &nbsp; appIE.Navigate('http://www.delphibbs.com');<br>&nbsp; &nbsp; IERestrictionsSettings('NoBrowserContextMenu', true);<br>end;<br><br>initialization<br> OleInitialize(nil);<br>finalization<br> try<br> OleUninitialize;<br> except<br> end;<br><br>end.<br>
 
调用<br>&nbsp; &nbsp; IERestrictionsSettings('NoBrowserContextMenu', false);<br>重新启动鼠标右键功能设置,其实就是改改注册表而已。<br>
 
怎么我没有收到了答案。
 
没太听明白题意~
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
D
回复
0
查看
1K
DelphiTeacher的专栏
D
I
回复
0
查看
976
import
I
D
回复
0
查看
2K
DelphiTeacher的专栏
D
后退
顶部