WH_GETMESSAGE & WH_MSGFILTER hook and sysmenu
I have the following hooks installed and I want to stop the sysmenu from
appearing when you press the alt key and then up/down arrow key. What would
be the best way to do this?
Any help greatly welcomed.
//WH_GETMESSAGE &&WH_MSGFILTER
LRESULT CALLBACK MemberGetMsgProc(int code, WPARAM wp, LPARAM lp)
{
if (code < 0) // do not process message
return CallNextHookEx(m_hgetmsg, code, wp, lp);
if(code == HC_ACTION)
{
MSG *Msg = reinterpret_cast<MSG *>(lp);
//TB_SETHOTITEM a toolbar item
if(Msg->message == WM_SYSKEYUP && Msg->wParam == VK_MENU)
SendMessage(Msg->message, Msg->wParam, Msg->lParam);
}
return CallNextHookEx(m_hgetmsg, code, wp, lp);
}
LRESULT CALLBACK MemberMsgFilterProc(int code, WPARAM wp, LPARAM lp)
{
if (code < 0) // do not process message
return CallNextHookEx(m_hmsgfilter, code, wp, lp);
if(code == MSGF_MENU)
{
MSG *Msg = reinterpret_cast<MSG *>(lp);
if(Msg->message == WM_MOUSEMOVE)
::SendMessage(m_hWnd, WM_MOUSEMOVE, wp, (LPARAM)&Msg->pt);
}
return CallNextHookEx(m_hmsgfilter, code, wp, lp);
}