[TLAC] Better window handle (custom game name patches are now possible)

This commit is contained in:
nastys
2019-11-23 19:37:16 +01:00
parent 76bc0e2e4a
commit 1c5e017636
3 changed files with 2 additions and 13 deletions
+2 -5
View File
@@ -16,6 +16,7 @@
#include <GL/freeglut.h>
#include <detours.h>
#include <fstream>
#pragma comment(lib, "detours.lib")
void(__cdecl* divaEngineUpdate)() = (void(__cdecl*)())0x14018CC40;
@@ -47,11 +48,7 @@ namespace TLAC
if ((MessageThread.Handle = CreateThread(0, 0, WindowMessageDispatcher, 0, 0, 0)) == NULL)
printf("[TLAC] InitializeTick(): CreateThread() Error: %d\n", GetLastError());
framework::DivaWindowHandle = FindWindow(0, framework::DivaWindowName);
if (framework::DivaWindowHandle == NULL)
framework::DivaWindowHandle = FindWindow(0, framework::GlutDefaultName);
if (framework::DivaWindowHandle == NULL)
framework::DivaWindowHandle = FindWindow(0, framework::freeGlutDefaultName);
framework::DivaWindowHandle = WindowFromDC(wglGetCurrentDC());
HRESULT diInitResult = Input::InitializeDirectInput(framework::Module);
if (FAILED(diInitResult))