Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Preventing Multiple Launches
Message
 
À
30/11/1999 12:59:12
Michael Dougherty
Progressive Business Publications
Malvern, Pennsylvanie, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00296974
Message ID:
00298778
Vues:
13
>Is there a simple way to prevent multiple launches, or do I have to create a process that can check if the program is running?

For testing, build an Executable of this code (not in interactive mode).

As commented in a previous message to George Tasker, the mutex object is automatically released by the system when the application exit.
*-- Code Start
#define ERROR_ALREADY_EXISTS 183

Declare Integer CreateMutex in win32api integer, integer, string
Declare Integer GetLastError in win32api

CreateMutex(0, 0, 'MutexTest');

if GetLastError() = ERROR_ALREADY_EXISTS
   MessageBox('Application ALREADY running', 0, 'Test Mutex')
else
   MessageBox('Application SUCESSFULLY running', 0, 'Test Mutex')
endif

Return

Just an opinion... Not a fact.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform