Windows 7 x64 bug on EnumWindow?
see the simple Delphi code here :
function EnumProc(Handle: THandle; Lparam: LPARAM): Bool; stdcall;
begin
TMemo(Lparam).Lines.Add(IntToStr(Handle));
end;
call it :
procedure TForm1.FormCreate(Sender: TObject);
begin
EnumWindows(@EnumProc, Lparam(Memo1))
end;
This code work successfully in Windows XP , Window 7 x86 and Windows 8 .
now test the code in Windows 7 x64, it only return one item , it means
windows just one time call EnumProc , it means the result of EnumProc is
false and no more window available to enumerate on it ...
now change our EnumProc to :
function EnumProc(Handle: THandle; Lparam: LPARAM): Bool; stdcall;
begin
TMemo(Lparam).Lines.Add(IntToStr(Handle));
result:= True;
end;
Ok , how about this ?! it will work on any version of Windows include
Windows 7 x64 !
Any idea ? is it a bug in Windows or wrong thing in my code ?
Regards Mojtaba .
No comments:
Post a Comment