Merge pull request #123 from qhy040404/windowhook

This commit is contained in:
HolographicHat
2025-01-17 17:13:59 +08:00
committed by GitHub

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;
}