Share via


SHRecognizeGesture

The SHRecognizeGesture function is typically used by custom controls to recognize certain stylus gestures. The one currently supported gesture is for context menus, where a context menu gesture is defined as when the user presses and holds the stylus in the same spot for some short period of time.

WINSHELLAPI DWORD SHRecognizeGesture( 
  SHRGINFO * shrg
);

Parameters

  • shrg
    Reference to a SHRGINFO structure.

Return Values

Returns 0 if there was no context menu gesture. If there was a context menu gesture, then one of the following will be returned:

If the dwFlags member of the SHRGINFO structure is SHRG_RETURNCMD, the function will return the GN_CONTEXTMENU notification message.

If the dwFlags member of the SHRGINFO structure is SHRG_NOTIFYPARENT, a WM_NOTIFY with GN_CONTEXTMENU will be sent to the parent of shrg->hwndClient, and the function will return whatever the return value from the WM_NOTIFY processing is.

A WM_NOTIFY with GN_CONTEXTMENU will be sent to shrg->hwndClient, and the function will return whatever the return value from the WM_NOTIFY processing is.

Remarks

Typically, a control will call this function during the WM_LBUTTONDOWN processing. If the user presses and holds long enough to warrant a context menu, a GN_CONTEXTMENU notification message will be returned by the function, or sent to the parent of the control, depending on the values in the SHRGINFO structure. Note that it is the responsibility of the application processing the GN_CONTEXTMENU notification message to bring up the menu.

Requirements

Pocket PC: Windows Mobile 2000 and later
OS Versions: Windows CE 3.0 and later
Header: aygshell.h
Library: aygshell.lib

See Also

GN_CONTEXTMENU

NMRGINFO

NM_RECOGNIZEGESTURE

SHRGINFO

Send feedback on this topic to the authors.

© 2005 Microsoft Corporation. All rights reserved.