CreateMutex(NULL, FALSE, T("YourApp_is_Running")); if ( GetLastError() == ERROR_ALREADY_EXISTS ) { // exit application ...... }