How to Prevent Tap-and-Hold Animation Display

Windows Mobile 6.5

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.

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.
        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);

Community Additions