Export (0) Print
Expand All

How to Prevent Tap-and-Hold Animation Display

Windows Mobile 6.5
4/19/2010

If you do not want to provide the standard animation feedback for a tap-and-hold gesture for your application, you can set the SHRG_NOANIMATION flag when calling the SHRecognizeGesture function, as shown in the following example message handler for WM_LBUTTONDOWN.

The following code example demonstrates how to use prevent tap-and-hold animation display.

Bb158553.note(en-us,MSDN.10).gifNote:
To make the following code example easier to read, security checking and error handling are not included. This code example should not be used in a release configuration unless it has been modified to include them.
    case WM_LBUTTONDOWN:
    {
        SHRGINFO  shrg;
        HMENU    hmenu;

        shrg.cbSize = sizeof(shrg);
        shrg.hwndClient = hWnd;
        shrg.ptDown.x = LOWORD(lParam);
        shrg.ptDown.y = HIWORD(lParam);
        shrg.dwFlags = SHRG_RETURNCMD | ;

        if (SHRecognizeGesture(&shrg) == GN_CONTEXTMENU) {
            hmenu = GetSubMenu(g_hMainMenu, 0);
            TrackPopupMenuEx(hmenu, TPM_LEFTALIGN, LOWORD(lParam),
                             HIWORD(lParam), hWnd, NULL);
        }
        break;
    }

Community Additions

ADD
Show:
© 2014 Microsoft