Einzelnen Beitrag anzeigen

Benutzerbild von Uncle Cracker
Uncle Cracker

Registriert seit: 30. Mär 2003
Ort: Freital
694 Beiträge
 
#2

Re: Läuft ein bestimmtes Programm?

  Alt 26. Okt 2003, 22:25
Vielleicht hilft dir das hier

Delphi-Quellcode:
function EnumWinProc(Wnd: hWnd): Boolean; StdCall;
 var
  WinCaption : Pchar;
  WinHandle : string;
 begin
   GetMem(WinCaption, 255);
   try
     GetWindowText(Wnd, WinCaption, 255);
     Result := True;
     if (Trim(WinCaption) <> '') then
     begin
       WinHandle := IntToHex(Wnd, 6);
       Form1.ListBox1.Items.add(WinHandle + ' : ' + WinCaption);
     end;
   finally
    FreeMem(WinCaption, 255);
   end;
 end;
Jedoch werden alle Prozesse in eine Listbox eingtragen, doch du willst nur nach einem bestimmt EXE-Namen suchen, oder?

[Edit]Aufgerufen wird so:

Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
begin
  EnumWindows(@EnumWinProc, Application.Handle);
end;
I wish it was legal to marry software because I'm madly in love with Delphi...
  Mit Zitat antworten Zitat