BOOL CXXXApp::InitInstance()
{
// At most run one instance in a moment
HANDLE hMutex = ::CreateMutex( NULL, TRUE, "MyProjectInstance" );
if ( NULL != hMutex )
{
if ( GetLastError() == ERROR_ALREADY_EXISTS )
{
return FALSE;
}
}
...
}