Y
ysp_1984
Unregistered / Unconfirmed
GUEST, unregistred user!
帮我看看这段代码怎么不对啊?
Function Tform1.EnumWindowsProc(hwnd:HWND;IParam:LPARAM):boolean;
Var
MyString : array[0..255] of char;
begin
if IsWindowVisible(hwnd) then
begin
if (hwnd<>form1.Handle) and (hwnd<>Application.Handle) then
GetWindowText(hwnd,@MyString,255);
if MyString<>'' then
form1.memo1.lines.Add(MyString);
Result := True;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
EnumWindows(@EnumWindowsProc,0);
end;
Function Tform1.EnumWindowsProc(hwnd:HWND;IParam:LPARAM):boolean;
Var
MyString : array[0..255] of char;
begin
if IsWindowVisible(hwnd) then
begin
if (hwnd<>form1.Handle) and (hwnd<>Application.Handle) then
GetWindowText(hwnd,@MyString,255);
if MyString<>'' then
form1.memo1.lines.Add(MyString);
Result := True;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
EnumWindows(@EnumWindowsProc,0);
end;