请问ie的工具栏的类名是'WorkerW'吗?(50分)

  • 主题发起人 主题发起人 notnoname
  • 开始时间 开始时间
N

notnoname

Unregistered / Unconfirmed
GUEST, unregistred user!
WorkerWHandle:=FindWindowEx(wParam,0,'WorkerW',nil);<br>wparam是一个ie窗口的句柄<br><br>但结果始终是0;
 
ToolbarWindow32
 
用一个小程序看看就知道了<br>unit Unit1;<br><br>interface<br><br>uses<br>&nbsp; Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,<br>&nbsp; Dialogs, ExtCtrls, StdCtrls;<br><br>type<br>&nbsp; TForm1 = class(TForm)<br>&nbsp; &nbsp; Timer1: TTimer;<br>&nbsp; &nbsp; labHandle: TLabel;<br>&nbsp; &nbsp; labClassName: TLabel;<br>&nbsp; &nbsp; labParent: TLabel;<br>&nbsp; &nbsp; procedure Timer1Timer(Sender: TObject);<br>&nbsp; private<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>procedure TForm1.Timer1Timer(Sender: TObject);<br>var<br>&nbsp; p:TPoint;<br>&nbsp; h:HWND;<br>&nbsp; s:array [0..255] of char;<br>begin<br>&nbsp; GetCursorPos(p);<br>&nbsp; h:=WindowFromPoint(p);<br>&nbsp; GetClassName(h,s,255);<br>&nbsp; labHandle.Caption:=format('0x%x',[h]);<br>&nbsp; labclassname.Caption:=s;<br>&nbsp; h:=GetParent(h);<br>&nbsp; GetClassName(h,s,255);<br>&nbsp; labParent.Caption:=s;<br>end;<br><br>end.<br>
 
很奇怪啊!<br>我已经得到了wParam一个ie窗口的句秉;<br>我直接用在WorkerWHandle:=FindWindowEx(wParam,0,'WorkerW',nil);无效,但是我把wParam的<br>数字直接写在上边的语句里却又有用了!<br>
 
nnd找到原因了,我的wParam 是一个integer必须和$00000000 and以下才能得到一个标准的<br>句秉。谢谢各位了!
 
多人接受答案了。
 
后退
顶部