[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))
@@ -7,10 +7,6 @@ namespace TLAC
std::string *framework::moduleDirectory;
const wchar_t* framework::DivaWindowName = L"Hatsune Miku Project DIVA Arcade Future Tone";
const wchar_t* framework::GlutDefaultName = L"GLUT";
const wchar_t* framework::freeGlutDefaultName = L"FREEGLUT";
HWND framework::DivaWindowHandle;
HMODULE framework::Module;
@@ -10,10 +10,6 @@ namespace TLAC
static std::string *moduleDirectory;
public:
static const wchar_t* DivaWindowName;
static const wchar_t* GlutDefaultName;
static const wchar_t* freeGlutDefaultName;
static bool inputDisable;
static HWND DivaWindowHandle;