GAME_API void SetHook ()
{
HWND HWND=: : FindWindow (L "Notepad", NULL);
M_hook=SetWindowsHookEx (WH_CBT CBTProc, GetModuleHandle (L "Game. DLL"), 0).
}
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- CBTProc () code -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
LRESULT a CALLBACK CBTProc (int nCode, WPARAM WPARAM, LPARAM LPARAM)
{
Return CallNextHookEx (m_hook, nCode wParam, lParam);
}
Game. DLL reference is normal, can appear in itself, in the process of application, m_hook return value is not empty,
But the Game. The DLL is injected to the notepad process
CodePudding user response:
HWND HWND=: : FindWindow (L "Notepad", NULL);Notepad window "Notepad" is the name of the class? The return value is normal?