Einzelnen Beitrag anzeigen

Benutzerbild von Sir Rufo
Sir Rufo

Registriert seit: 5. Jan 2005
Ort: Stadthagen
9.454 Beiträge
 
Delphi 10 Seattle Enterprise
 
#3

AW: Problem beim Programmneustart mit Instanzkontrolle

  Alt 7. Nov 2013, 01:59
Ich würde vor dem Aufruf des Programms den Mutex wieder freigeben ...

BTW

Den Code in finalization kannst du dir sparen, denn
Zitat:
Use the CloseHandle function to close the handle. The system closes the handle automatically when the process terminates. The mutex object is destroyed when its last handle has been closed.
schön ist auch
Zitat:
If you are using a named mutex to limit your application to a single instance, a malicious user can create this mutex before you do and prevent your application from starting. To prevent this situation, create a randomly named mutex and store the name so that it can only be obtained by an authorized user. Alternatively, you can use a file for this purpose. To limit your application to one instance per user, create a locked file in the user's profile directory.
Quelle: http://msdn.microsoft.com/en-us/libr...(v=vs.85).aspx
Kaum macht man's richtig - schon funktioniert's
Zertifikat: Sir Rufo (Fingerprint: ‎ea 0a 4c 14 0d b6 3a a4 c1 c5 b9 dc 90 9d f0 e9 de 13 da 60)

Geändert von Sir Rufo ( 7. Nov 2013 um 02:08 Uhr)
  Mit Zitat antworten Zitat