diff --git a/Source/diablo.cpp b/Source/diablo.cpp index c499b0786..8ac2cf3b9 100644 --- a/Source/diablo.cpp +++ b/Source/diablo.cpp @@ -494,7 +494,7 @@ void __cdecl diablo_init_screen() } // 69CEFC: using guessed type int scrollrt_cpp_init_value; -HWND __fastcall diablo_find_window(LPCSTR lpClassName) +BOOL __fastcall diablo_find_window(LPCSTR lpClassName) { HWND result; // eax HWND v2; // esi @@ -503,19 +503,18 @@ HWND __fastcall diablo_find_window(LPCSTR lpClassName) result = FindWindowA(lpClassName, 0); v2 = result; - if ( result ) - { - v3 = GetLastActivePopup(result); - if ( v3 ) - v2 = v3; - v4 = GetTopWindow(v2); - if ( !v4 ) - v4 = v2; - SetForegroundWindow(v2); - SetFocus(v4); - result = (HWND)1; - } - return result; + if ( !result ) + return 0; + + v3 = GetLastActivePopup(result); + if ( v3 ) + v2 = v3; + v4 = GetTopWindow(v2); + if ( !v4 ) + v4 = v2; + SetForegroundWindow(v2); + SetFocus(v4); + return 1; } void __fastcall diablo_reload_process(HMODULE hModule) diff --git a/Source/diablo.h b/Source/diablo.h index 8cf2862f1..0f312eb64 100644 --- a/Source/diablo.h +++ b/Source/diablo.h @@ -45,7 +45,7 @@ bool __cdecl diablo_get_not_running(); int __stdcall WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd); void __fastcall diablo_parse_flags(char *args); void __cdecl diablo_init_screen(); -HWND __fastcall diablo_find_window(LPCSTR lpClassName); +BOOL __fastcall diablo_find_window(LPCSTR lpClassName); void __fastcall diablo_reload_process(HMODULE hModule); int __cdecl PressEscKey(); LRESULT __stdcall DisableInputWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);