mirror of
https://github.com/simtactics/niotso.git
synced 2025-03-15 08:11:22 +00:00
Reverted to the original GetLastError() method for CreateMutex(), as, it turns out, Microsoft lied. Even when the function fails, it returns non-NULL.
This commit is contained in:
parent
c5117169b9
commit
64a5c0a425
1 changed files with 2 additions and 1 deletions
|
@ -25,7 +25,8 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR, int)
|
|||
int result;
|
||||
|
||||
//Disallow multiple instances of the game from running
|
||||
if(CreateMutex(NULL, TRUE, "TSO_NIOTSO_MUTEX") == NULL){
|
||||
CreateMutex(NULL, TRUE, "Global\\TSO_NIOTSO_MUTEX");
|
||||
if(GetLastError() == ERROR_ALREADY_EXISTS){
|
||||
HWND hWnd = FindWindow("TSO_NIOTSO", "The Sims Online");
|
||||
if(hWnd != NULL){
|
||||
ShowWindow(hWnd, SW_RESTORE);
|
||||
|
|
Loading…
Add table
Reference in a new issue