This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

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_NOANIMATIONflag when calling the SHRecognizeGesturefunction, as shown in the following example message handler for WM_LBUTTONDOWN.

Code Example

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

See Also