Fixed overlay on x64

They are not longer available with GetWindowLong. There is a new function GetWindowLongPtr.
GWLP* must be used.
This commit is contained in:
Nemirtingas 2019-08-21 10:46:58 +02:00
parent 5a0653d080
commit 0fa2d82c67
2 changed files with 4 additions and 7 deletions

View file

@ -14,16 +14,13 @@ HWND GetGameWindow()
{
if (!GetParent(hWnd))
{
#if defined(_WIN64)
if (GetModuleHandle(NULL) == (HINSTANCE)GetWindowLong(hWnd, GWLP_HINSTANCE))
if (GetModuleHandle(NULL) == (HMODULE)GetWindowLongPtr(hWnd, GWLP_HINSTANCE))
break;
#elif defined(_WIN32)
if (GetModuleHandle(NULL) == (HINSTANCE)GetWindowLong(hWnd, GWL_HINSTANCE))
break;
#endif
}
hWnd = GetWindow(hWnd, GW_HWNDNEXT);
}
if (!hWnd)
PRINT_DEBUG("Failed to get game window HWND\n");
return hWnd;
}