Autor Beitrag
NTM
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 120

Win XP
2005 Prof
BeitragVerfasst: Do 25.01.07 11:24 
Hallo zusammen,
ich habe eine kleines Problem und zwar ich möchte das meine Prog nur einmal gestarte werden kann. Momentan ist es so das man das Prog mehrfach starten kann und bei schließen des Prog trotzdem im Task Menü bestehen bleibt.Das heißt schließe ich alle Prog die ich geöffnent habe sind Sie trotzdem noch der Task vorhanden.
Ich schließe das Prog mit dem Befehl Terminate aber trotzdem bleibt das Prog in der Task sichtbar.

Ich bedanke mich schon einmal im vorraus


Moderiert von user profile iconjasocul: Topic aus Datenbanken verschoben am Do 25.01.2007 um 11:17
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10183
Erhaltene Danke: 1256

W10ent
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Do 25.01.07 11:30 
Moin!

Die Suche hilft: Suche in: Delphi-Forum, Delphi-Library MEHRFACHSTART ;)

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
nivosta
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 35



BeitragVerfasst: Do 25.01.07 11:33 
Hi,

Schau dir mal die Funktion CreateMutex an
ZeitGeist87
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1593
Erhaltene Danke: 20

Win95-Win10
Delphi 10 Seattle, Rad Studio 2007, Delphi 7 Prof., C++, WSH, Turbo Pascal, PHP, Delphi X2
BeitragVerfasst: Do 25.01.07 11:54 
Hallo!

Einfach ne neue Unit erstellen

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
unit IrgendeinUnitName;

 interface

 implementation

 uses windows,Dialogs,sysutils;

 var mHandle: THandle;    // Mutexhandle

 Initialization
   mHandle := CreateMutex(nil,True,'DerNameDeinerAnwendung'); // Anwendungsname
   if GetLastError = ERROR_ALREADY_EXISTS then
   begin
     messagedlg('Anwendung läuft bereits!', mtwarning, [mbok], 0);
     Halt;
   end;

 finalization   // ... und Schluß
   if mHandle <> 0 then
     CloseHandle(mHandle)
end.


Lg
Stefan

_________________
Wer Provokationen, Ironie, Sarkasmus oder Zynismus herauslesen kann soll sie ignorieren um den Inhalt meiner Beiträge ungetrübt erfassen zu können.