WM_TABLET_QUERYSYSTEMGESTURESTATUS message
Sent when the system asks a window which system gestures it would like to receive.
#define WM_TABLET_DEFBASE 0x02C0
#define WM_TABLET_QUERYSYSTEMGESTURESTATUS (WM_TABLET_DEFBASE + 12)
Parameters
-
wParam
-
Not used.
-
lParam
-
A point value that represents the screen coordinates.
Remarks
By handling this message, you can dynamically disable flicks for regions of a window.
Note
The lParam can be converted to x-coordinates and y-coordinates by using the GET_X_LPARAM
and GET_Y_LPARAM
macros.
By default, your window will receive all system gesture events. You can choose which events you would like your window to receive and which events you would like disabled by responding to the WM_TABLET_QUERYSYSTEMGESTURESTATUS message in your WndProc. The WM_TABLET_QUERYSYSTEMGESTURESTATUS message is defined in tpcshrd.h. The values to enable and disable system tablet system gestures are also defined in tpcshrd.h as follows:
#define TABLET_DISABLE_PRESSANDHOLD 0x00000001
#define TABLET_DISABLE_PENTAPFEEDBACK 0x00000008
#define TABLET_DISABLE_PENBARRELFEEDBACK 0x00000010
#define TABLET_DISABLE_TOUCHUIFORCEON 0x00000100
#define TABLET_DISABLE_TOUCHUIFORCEOFF 0x00000200
#define TABLET_DISABLE_TOUCHSWITCH 0x00008000
#define TABLET_DISABLE_FLICKS 0x00010000
#define TABLET_ENABLE_FLICKSONCONTEXT 0x00020000
#define TABLET_ENABLE_FLICKLEARNINGMODE 0x00040000
#define TABLET_DISABLE_SMOOTHSCROLLING 0x00080000
#define TABLET_DISABLE_FLICKFALLBACKKEYS 0x00100000
#define TABLET_ENABLE_MULTITOUCHDATA 0x01000000
Note
Disabling press and hold will improve responsiveness for mouse clicks because this functionality creates a wait time to distinguish between the two operations.
Use caution when handling the WM_TABLET_QUERYSYSTEMGESTURESTATUS message. WM_TABLET_QUERYSYSTEMGESTURESTATUS is passed using the SendMessageTimeout function. If you call methods on a COM interface, that object must be within the same process. If not, COM throws an exception.
Examples
The following example shows how to disable flicks for a region using WM_TABLET_QUERYSYSTEMGESTURESTATUS.
#include <windowsx.h>
(...)
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam){
case WM_TABLET_QUERYSYSTEMGESTURESTATUS:
int x = GET_X_LPARAM(lParam);
int y = GET_Y_LPARAM(lParam);
if (x < xThreashold && y < yThreshold){
// no flicks in the region specified by the threashold
return TABLET_DISABLE_FLICKS;
}
// flicks will happen otherwise
return 0;
}
The following example shows how to disable various flicks features for an entire window.
const DWORD dwHwndTabletProperty =
TABLET_DISABLE_PRESSANDHOLD | // disables press and hold (right-click) gesture
TABLET_DISABLE_PENTAPFEEDBACK | // disables UI feedback on pen up (waves)
TABLET_DISABLE_PENBARRELFEEDBACK | // disables UI feedback on pen button down (circle)
TABLET_DISABLE_FLICKS; // disables pen flicks (back, forward, drag down, drag up)
void SetTabletpenserviceProperties(HWND hWnd){
ATOM atom = ::GlobalAddAtom(MICROSOFT_TABLETPENSERVICE_PROPERTY);
::SetProp(hWnd, MICROSOFT_TABLETPENSERVICE_PROPERTY, reinterpret_cast<HANDLE>(dwHwndTabletProperty));
::GlobalDeleteAtom(atom);
}
Requirements
Requirement | Value |
---|---|
Minimum supported client |
Windows Vista [desktop apps only] |
Minimum supported server |
Windows Server 2008 [desktop apps only] |
Header |
|