S
sy0116
Unregistered / Unconfirmed
GUEST, unregistred user!
用以下代码查找QQ聊天模式发送信息的richedit的句柄,找到两个,有什么办法能区分吗<br>type<br> TForm1 = class(TForm)<br> Button1: TButton;<br> procedure Button1Click(Sender: TObject);<br> private<br><br> public<br> { Public declarations }<br> end;<br><br>function EnumAllWindow(hWnd:HWND; lParam:LPARAM): BOOL; stdcall;<br>var<br> Form1: TForm1;<br><br>implementation<br><br>{$R *.dfm}<br>function EnumAllWindow(hWnd: HWND; lParam: LPARAM): BOOL;<br>var<br> ClassName: Array[0..255] of char;<br>begin<br> GetClassName(hWnd,ClassName,255);<br> if ClassName = 'RICHEDIT' then<br> begin<br> ShowMessage(IntToStr(hWnd));<br> end;<br> Result:=TRUE;<br>end;<br><br>procedure TForm1.Button1Click(Sender: TObject);<br>var<br> hd, childhd: THandle;<br>begin<br> hd := FindWindow(nil, 'abcd');<br><br> if hd <> 0 then<br> EnumChildWindows(hd, @EnumAllWindow, 0)<br>end;