Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
One Instance
Message
 
À
26/11/2004 10:45:37
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Versions des environnements
Visual FoxPro:
VFP 7
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
00957965
Message ID:
00965017
Vues:
12
>>Function IsAppRunning
>> Lparameters tcSemaphoreName
>> Local hsem, lpszSemName
>> #Define ERROR_ALREADY_EXISTS 183
>> Declare Integer GetLastError In win32API
>> Declare Integer CreateSemaphore In WIN32API ;
>> string @ lpSemaphoreAttributes, ;
>> LONG lInitialCount, ;
>> LONG lMaximumCount, ;
>> string @ lpName
>> hsem = CreateSemaphore(0,0,1,tcSemaphoreName)
>> Return (hsem # 0 And GetLastError() == ERROR_ALREADY_EXISTS)
>>Cetin

I do not the answer Fabio, but what about including the HWND into the semaphore's name?, something like:

lcSemaphoreName = tcSemaphoreName + "~" + transform(thisform.HWND)

Then you can parse the name of the semaphore to get the Window Handle and activate it.

Just a thought
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform