In the CBTProc hook, there's: return 0 to allow the msg, 1 to deny.
What about the WH_GETMESSAGE hook? How I could 'block' a message from being executed?
In this example:
LRESULT CALLBACK GetMsgProc(_In_ int nCode, _In_ WPARAM wParam, _In_ LPARAM lParam
)
{
if (nCode < 0)
return CallNextHookEx(nullptr, nCode, wParam, lParam);
MSG* pMsg = (MSG*)lParam;
if ((pMsg->message == WM_KEYDOWN) && (wParam == PM_REMOVE))
{
}
return CallNextHookEx(g->getmsgproc, nCode, wParam, lParam);
}
When the code gets inside of the block if ((pMsg->message == WM_KEYDOWN), how i could deny it from executing the WM_KEYDOWN msg?
Do I need to replace pMsg->message with something else or what?
Inside of both return CallNextHookEx(... the first parameter must be nullptr?