function EnumWindowProc(AWnd: HWND;
AlParam: LPARAM):Boolean;stdcall;
var
strCaption,strClassName: pChar;
begin
GetMem(strCaption, 255);
GetMem(strClassName, 255);
GetWindowText(AWnd, strCaption,255);
GetClassName(AWnd, strClassName, 255);
FormMain.AddMainWnd(strpas(strCaption), strpas(strClassName), IntToStr(Awnd));
Result := True;
end;
希望对你有用