在窗口处理函数中:
case WM_LBUTTONDOWN:
{
SHRGINFO shrg;
shrg.cbSize = sizeof(shrg);
shrg.hwndClient = m_hWnd;
shrg.ptDown.x = LOWORD(lParam);
shrg.ptDown.y = HIWORD(lParam);
shrg.dwFlags = SHRG_RETURNCMD;
CPoint point;
point.x = shrg.ptDown.x;
point.y = shrg.ptDown.y;
if(::SHRecognizeGesture(&shrg) == GN_CONTEXTMENU)//长按键消息
{
<<事件处理程序>>
}
}
阅读(1094) | 评论(0) | 转发(0) |