Afficher un message
Vieux 11/10/2007, 11h57   #11
TedIF
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Comment obtenir le hwindow d'une application à partir d'un processId

> procedure GetProcessWindowList(AProcessId : DWord; AList : TStrings);
> var
> LeHWnd : HWnd;
> szTitre : Array[0..255] of Char;
> AP2 : DWord;
> begin
> AList.Clear;
> LeHWnd:=GetWindow(GetDesktopWindow,GW_CHILD);
> LeHWnd:=GetWindow(LeHWnd,GW_HWNDFIRST);
> while LeHWnd<>0 do
> begin
> GetWindowText(LeHWnd,szTitre,255);
> GetWindowThreadProcessId(LeHWnd, @AP2);
> if (AP2=AProcessId) and (AP2<>0) and (StrLen(szTitre)>0) then
> AList.AddObject(StrPas(szTitre),Pointer(LeHWnd));
> LeHWnd:=GetWindow(LeHWnd,GW_HWNDNEXT);
> end;
> end;
>
>

Merci bien

--

Dominique


  Réponse avec citation
 
Page generated in 0,04525 seconds with 9 queries