您的位置:首页 > 其它

取消Win7应用中的模拟右键功能,及其他WIN7触控特效的开关

2013-04-18 14:34 309 查看
简单来说就是系统会通过消息问你要不要接受右键事件,默认不反应就是接受,你可以自己写处理代码表示自己不接受. 那么当你触控按住的时候就不会划圈圈.而且你的"按住不放"这样的事件逻辑可以正常工作了.英文不是问题,大家自己看吧. by TimeLink Technology Co.,LTD

WM_TABLET_QUERYSYSTEMGESTURESTATUS message

Applies to: desktop apps only

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 andGET_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 theWM_TABLET_QUERYSYSTEMGESTURESTATUS message in your WndProc. TheWM_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.

C++

#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.

C++

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

Minimum supported client
Windows Vista
Minimum supported server
Windows Server 2008
Header
Tpcshrd.h
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: