Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Starting application
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00424335
Message ID:
00424409
Vues:
20
>>Is there a way to prevent starting a second time the same application (.exe) ?
>>
>>thank you
>
>This is from Ed Rauh: (check FAQ here and API)
>
>
>DECLARE INTEGER CreateEvent IN WIN32API ;
>   INTEGER lpEventAttributes, ;
>   SHORT bManualReset, ;
>   SHORT bInitialState, ;
>   STRING @ lpName
>DECLARE INTEGER GetLastError IN Win32API
>DECLARE CloseHandle IN Win32API INTEGER hObject
>nEh = CreateEvent(0,0,1, PROGRAM(0) + '.EVENT')
>IF GetLastError() = 183 OR nEh = 0
>   *  There's an instance running already (183) or the Event can't be defined
>   *  So don't do it;  do release the handle, since it's harmless and should
>   *  be done rather than relying on Windows to clean up after itself
>   =CloseHandle(nEh)
>   QUIT
>ENDIF
I'm dreaming, or UT found a way for color highlighting of VFP sample code? ;)
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform