The most efficient way would be to create a MUTEX using win32 functions 'CreateMutex','OpenMutex', etc.