mirror of
https://github.com/Raymonf/whack.git
synced 2024-11-24 00:20:10 +01:00
galliumhook: readme, ability to disable wndproc hook
This commit is contained in:
parent
46d9ff33aa
commit
27dc67e8b8
14
galliumhook/README.md
Normal file
14
galliumhook/README.md
Normal file
@ -0,0 +1,14 @@
|
||||
# galliumhook
|
||||
|
||||
Loads `mercuryhook.dll` at startup and then forces created windows to be 1080x1920 regardless of screen resolution (or original size).
|
||||
|
||||
If you want to configure galliumhook without recompiling it, make a file named `galliumhook.toml` and put this in:
|
||||
|
||||
```toml
|
||||
[window]
|
||||
width = 1080
|
||||
height = 1920
|
||||
wndproc = 0x72AE80
|
||||
```
|
||||
|
||||
Note that sane defaults (for 3.07.01 ONLY) will be applied when this config file isn't found. Set wndproc to 0 to disable the WndProc hook.
|
@ -48,7 +48,6 @@ int CreateHooks()
|
||||
{
|
||||
OutputDebugStringW(L"[galliumhook] CreateHooks()\r\n");
|
||||
auto base = (uint64_t)GetModuleHandleW(NULL);
|
||||
WndProc = (tWndProc)(base + wndProcAddr);
|
||||
|
||||
if (MH_Initialize() != MH_OK)
|
||||
{
|
||||
@ -56,8 +55,12 @@ int CreateHooks()
|
||||
return 0;
|
||||
}
|
||||
|
||||
auto createResult = MH_CreateHook(WndProc, &DetourWndProc, reinterpret_cast<LPVOID*>(&fpWndProc));
|
||||
if (createResult != MH_OK)
|
||||
if (wndProcAddr != 0)
|
||||
{
|
||||
OutputDebugStringW(L"[galliumhook] Creating WndProc hook\r\n");
|
||||
WndProc = (tWndProc)(base + wndProcAddr);
|
||||
|
||||
if (MH_CreateHook(WndProc, &DetourWndProc, reinterpret_cast<LPVOID*>(&fpWndProc)) != MH_OK)
|
||||
{
|
||||
MessageBox(NULL, L"Couldn't create WndProc hook", L"galliumhook", MB_OK);
|
||||
return 0;
|
||||
@ -68,6 +71,11 @@ int CreateHooks()
|
||||
MessageBox(NULL, L"Couldn't enable WndProc hook", L"galliumhook", MB_OK);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
OutputDebugStringW(L"[galliumhook] Not creating WndProc hook\r\n");
|
||||
}
|
||||
|
||||
if (MH_CreateHook(&CreateWindowExW, &DetourCreateWindowExW, reinterpret_cast<LPVOID*>(&fpCreateWindowExW)) != MH_OK)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user