add window hook entry

This commit is contained in:
qhy040404
2025-01-17 17:11:25 +08:00
parent 01a3f41323
commit 957c8b98e4

View File

@@ -192,6 +192,11 @@ DWORD __stdcall ThreadProc(LPVOID hInstance)
// DLL entry point
BOOL __stdcall DllMain(HMODULE hInstance, DWORD fdwReason, LPVOID lpReserved)
{
// check injectee
if (!GetModuleHandleW(L"mhypbase.dll"))
{
return TRUE;
}
if (fdwReason == DLL_PROCESS_ATTACH)
{
@@ -202,3 +207,14 @@ BOOL __stdcall DllMain(HMODULE hInstance, DWORD fdwReason, LPVOID lpReserved)
return TRUE;
}
static LRESULT WINAPI YaeGetWindowHookImpl(int code, WPARAM wParam, LPARAM lParam)
{
return CallNextHookEx(NULL, code, wParam, lParam);
}
EXTERN_C __declspec(dllexport) HRESULT WINAPI YaeGetWindowHook(_Out_ HOOKPROC* pHookProc)
{
*pHookProc = YaeGetWindowHookImpl;
return S_OK;
}