Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to prevent the application running twice ?
Message
De
12/06/2007 02:37:30
 
 
À
11/06/2007 23:52:53
Yim Ming Sun Derek
Spacious Design Consultant
Hong Kong, Hong Kong
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01232152
Message ID:
01232172
Vues:
43
>Hi,
>How can I control to prevent the vfp9 application running
>twice ?
>
>Please advise.
>
>Thanks.
>Derek Yim
Local oMutex, cformcaptiono
cformcaptiono= _SCREEN.Caption
_Screen.Caption= ""
cformcaption= "This title and version... V 5.312"
lTellTime= .T.
oMutex = CREATEOBJECT('Mutex', cformcaption)
If oMutex.nMutexError # ERROR_ALREADY_EXISTS
   _Screen.Caption = cformcaption
Else
   oMutex.DisplayInstance()
   WAIT WINDOW "This Application is already being run from this workstation!" TIMEOUT 13
   _SCREEN.Caption= cformcaptiono
   oMutex = .NULL.
   ON SHUTDOWN 
   Return
Endif
*... your startup code
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform