I used this code with
CreateMutex similar in earlier times.
HANDLE m_hMutex;
CString Mutex = CString("Global\\")+AppTitel;
m_hMutex = CreateMutex(NULL, false, Mutex);
if (m_hMutex == NULL || GetLastError() == ERROR_ALREADY_EXISTS) {
return false;
}
if (m_hMutex) {CloseHandle(m_hMutex); m_hMutex = NULL;}