Share via


Get Gesture Information (Compact 2013)

3/26/2014

When a gesture event occurs, GWES sends a gesture message to all the windows that you specified in calls to EnableGestures to enable the gesture type.

You call GetGestureInfo, a function provided by the gesture core, to get information about the event. You pass the handle that is in member lparam of the gesture message, and you pass a pointer to a GESTUREINFO structure. GetGestureInfo places the gesture event information in the structure.

The gesture core API definitions are in Winuser.h. The following code is the definition of GESTUREINFO.

typedef struct tagGESTUREINFO
{
    UINT cbSize;                /* Initialised to structure size */
    DWORD dwFlags;              /* Gesture Flags */
    DWORD dwID;                 /* Gesture ID */
    HWND hwndTarget;            /* HWND of target window */
    POINTS ptsLocation;         /* Coordinates of start of gesture */
    DWORD dwInstanceID;         /* Gesture Instance ID */
    DWORD dwSequenceID;         /* Gesture Sequence ID */
    ULONGLONG ullArguments;     /* Arguments specific to gesture */
    UINT cbExtraArguments;      /* Size of extra arguments in bytes */
} GESTUREINFO, * PGESTUREINFO;

Member dwFlags is a bitmap that holds gesture flags. The following table shows the flags and their meanings.

Flag

Meaning when flag is set

GF_BEGIN

The gesture started.

GF_INERTIA

A pan gesture has transitioned to a flick gesture.

GF_END

The gesture ended.

GF_SYMMETRIC

The gesture is a two-finger gesture from a symmetric panel.

For a tap (select) gesture, both GF_BEGIN and GF_END are set.

Member dwID provides the gesture type. The following table describes the gesture types.

Gesture type

Description

GID_BEGIN

The user began a touch gesture by touching the screen.

GID_END

The user ended a gesture by removing their finger from the screen.

GID_PAN

The user touched the screen (generating an earlier GID_BEGIN event) and moved their finger.

GID_ROTATE

Reserved.

GID_SCROLL

The user touched the screen, moved their finger quickly, and lifted it. This gesture is often called a flick.

GID_HOLD

The user touched the screen and held it there for longer than the hold time-out period. A hold corresponds to a mouse right-click.

GID_SELECT

The user touched the screen and held it there for shorter than the hold time-out period. This gesture is often called a tap.

GID_DOUBLESELECT

The user tapped two times on the screen in less time than the hold time-out. This gesture is often called a double-tap, and corresponds to a double-click of the left mouse key.

GID_DIRECTMANIPULATION

The user touched the screen and moved their finger. When direct manipulation is enabled, pan is disabled. Therefore, this gesture cannot be interpreted as a pan.

For more information about the gesture types, see Gesture Commands.

For more information about the GESTUREINFO structure, see GESTUREINFO.

See Also

Concepts

Gesture Applications