![]() |
Task überprüfen
Hi, kann mir wer sagen, wie ich überprüfen kann, ob zb: Opera.exe läuft?
Danke, Gruß Pump :angel: |
Re: Task überprüfen
Moin Pump,
ich prüfe auf diese Art, ob mein Programm schon läuft ....
Delphi-Quellcode:
HTH
// ist das Programm schon gestartet ??
initialization H := CreateMutex(nil, True, 'Opera.exe'); if GetLastError = ERROR_ALREADY_EXISTS then begin MessageDlg('Opera' +#13+#13+'das Programm ist bereits aktiv.', mtInformation, [mbOk], 0); Halt; end; finalization if H <> 0 then begin CloseHandle(H); end; Gruß ascotlx |
Re: Task überprüfen
Delphi-Quellcode:
unit test;
interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ShellAPI; type TForm1 = class(TForm) private { Private-Deklarationen } public { Public-Deklarationen } end; var Form1: TForm1; implementation var H : THandle; {$R *.dfm} initialization H := CreateMutex(nil, True, 'Opera.exe'); if GetLastError = ERROR_ALREADY_EXISTS then begin MessageDlg('Opera' +#13+#13+'das Programm ist bereits aktiv.', mtInformation, [mbOk], 0); Halt; end; finalization if H <> 0 then begin CloseHandle(H); end; end. dat will nicht so wie ich will :( |
Re: Task überprüfen
naja ok es funktioniert jetzt.
nur mein problem ist: wenn ich mein testprogramm starte, und es nochmal starte, dann kommt eben der message dialog und das programm beendet. ich wollte aber beim start meines testprogramms überprüfen ob die exe vom Opera Broweser (Opera.exe) gestartet ist. also nicht überprüfen ob die testexe schon läuft. |
Alle Zeitangaben in WEZ +1. Es ist jetzt 05:47 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz