Group: Synchronization - Library: kernel32
Using the Semaphore object
Using the Semaphore object to allow only one instance of VFP application running
HANDLE OpenSemaphore(
DWORD dwDesiredAccess, // access
BOOL bInheritHandle, // inheritance option
LPCTSTR lpName // object name
);
DECLARE INTEGER OpenSemaphore IN kernel32;
INTEGER dwDesiredAccess,;
INTEGER bInheritHandle,;
STRING lpName
fdwAccess Specifies the requested access to the semaphore object
fInherit Specifies whether the returned handle is inheritable
lpszSemName Points to a null-terminated string that names the semaphore to be opened. Name comparisons are case sensitive
If the function succeeds, the return value is a handle of the semaphore object