Einzelnen Beitrag anzeigen

Benutzerbild von toms
toms
(CodeLib-Manager)

Registriert seit: 10. Jun 2002
4.648 Beiträge
 
Delphi XE Professional
 
#15

Re: Textinhalt eines Objekts einer anderen Anwendung

  Alt 1. Mai 2008, 10:33
Zitat von napsterxx:
Und wie geht das :S

Delphi-Quellcode:
function FindGarenaMainWindow: Hwnd;
const
  GarenaWindowTitle = 'Garena ';
  GarenaClassName = 'Afx:';
var
  NextHandle: Hwnd;
  WinTitle, WinClass: array[0..255] of char;
begin
  Result := 0;
  NextHandle := GetWindow(Application.Handle, GW_HWNDFIRST);
  while NextHandle > 0 do
  begin
    GetWindowText(NextHandle, WinTitle, SizeOf(WinTitle));
    GetClassName(NextHandle, WinClass, SizeOf(WinClass));
    if (Copy(WinTitle, 1, Length(GarenaWindowTitle)) = GarenaWindowTitle) and
    (Copy(WinClass, 1, Length(GarenaClassName)) = GarenaClassName) then
    begin
      Result := NextHandle;
      Break;
    end
    else
      NextHandle := GetWindow(NextHandle, GW_HWNDNEXT);
  end;
end;
Thomas
  Mit Zitat antworten Zitat