function EnumWindows (
lpEnumFunc: TFNWndEnumProc;
lParam: LPARAM): BOOL; stdcall;
type
EnumWindowsProc = function (Hwnd: THandle;
Param: Pointer): Boolean; stdcall;
function GetTitle (Hwnd: THandle; Param: Pointer): Boolean; stdcall;
var
Text: string;
begin
SetLength (Text, 100);
GetWindowText (Hwnd, PChar (Text), 100);
FormCallBack.ListBox1.Items.Add (
IntToStr (Hwnd) + ': ' + Text);
Result := True;
end;
procedure TFormCallback.BtnTitlesClick(Sender: TObject);
var
EWProc: EnumWindowsProc;
begin
ListBox1.Items.Clear;
EWProc := GetTitle;
EnumWindows (@EWProc, 0);
end;
调用getTitle时,参数是如何传递给它?
Hwnd: THandle;
Param: Pointer
分别传入了什么参数?