Link to home
Start Free TrialLog in
Avatar of hansw77041
hansw77041

asked on

Pocket PC Context menu in a dialog and GN_CONTEXTMENU

eVC++ 4.0 IDE ClassWizard allows me to add the event handler for OnContextMenu()
However that does not appear to work on the PocketPC as it does in normal Windows.

I found this article with code for adding a context menut to a control  http://www.pocketpcdn.com/articles/contextmenu.html  and it works OK.

However I would like to add a Context menu to the main dialog and need some help handling the GN_CONTEXTMENU message.

ON_NOTIFY(GN_CONTEXTMENU, OnContextMenu) produces a compiler error warning C4003: not enough actual parameters for macro 'ON_NOTIFY'

Just how would I handle the GN_CONTEXTMENU message in the main dialog ?
Avatar of hansw77041
hansw77041

ASKER

OK GN_CONTEXTMENU is not handled directly, in fact it is handled in OnLButtonDown();

void CPopupTestDlg::OnLButtonDown(UINT nFlags, CPoint point)
{
       SHRGINFO shrgi = {0};

        shrgi.cbSize = sizeof(SHRGINFO);
    shrgi.hwndClient = m_hWnd;
      shrgi.ptDown.x = point.x;
      shrgi.ptDown.y = point.y;
       shrgi.dwFlags = SHRG_RETURNCMD;

      
      if(::SHRecognizeGesture(&shrgi) == GN_CONTEXTMENU)
      {
              DoContextMenu(point);
      }
        else
      {
              Default();
      }
}
ASKER CERTIFIED SOLUTION
Avatar of PAQ_Man
PAQ_Man
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial