首页 > 代码库 > delphi 遍历窗口

delphi 遍历窗口

function EnumWindowsProc(hwnd: HWND; lparam: LPARAM): Boolean; stdcall;var  buf: array[Byte] of Char;begin  Result:= True;  GetWindowText(hwnd, buf, SizeOf(buf));  Form1.Memo1.Lines.Add(buf);  Form1.Memo1.Lines.Add(IntToStr(hwnd));end;procedure TForm1.Button1Click(Sender: TObject);begin  EnumWindows(@enumwindowsproc,0);  EnumChildWindows(HWND,@enumwindowsproc,0);   //遍历子窗口多了一个参数.父窗口end;