S
sy0116
Unregistered / Unconfirmed
GUEST, unregistred user!
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 = 'EDIT' 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, ABC');<br><br> if hd <> 0 then<br> EnumChildWindows(hd, @EnumAllWindow, 0)<br>end;<br>把ShowMessage(IntToStr(hWnd));换成edit2.text=IntToStr(hWnd);怎么不行?<br>[Error] nqq.pas(49): Undeclared identifier: 'edit2'<br>[Error] nqq.pas(49): Missing operator or semicolon