Einzelnen Beitrag anzeigen

gandime
(Gast)

n/a Beiträge
 
#7

Re: Handle eines Fensters über die Processid?

  Alt 26. Jul 2007, 13:07
mit folgendem Code habe ich jetzt versucht das Handle zu finden aber hatte keinen Erfolg

Delphi-Quellcode:
 

ProcInfo: TProcessInformation;

function GetWindows(const hWnd: Longword; Param: PMyEnumParam): LongBool;
  stdcall;
var
  Len: Longint;
  dwThreadID:dword;
begin
  Result := True;
  if not (IsWindow(hWnd) and IsWindowVisible(hWnd)) then
    Exit;
  Len := SendMessage(hWnd, WM_GETTEXTLENGTH, 0, 0);
  if Len > 0 then
  begin
    if (ProcInfo.dwProcessId=GetWindowThreadProcessId(hWnd,nil)) then
    begin
      MessageBox(0, 'hier', 'joa', 0);
    end;
  end;
end;

begin
 EnumWindows(@GetWindows, LPARAM(@Param));
end;
kann es vlt daran liegen das ProcInfo.dwProcessId ein Cardinal ist und GetWindowThreadProcessId ein DWORD ist?
  Mit Zitat antworten Zitat