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

简单来说就是系统会通过消息问你要不要接受右键事件,默认不反应就是接受,你可以自己写处理代码表示自己不接受. 那么当你触控按住的时候就不会划圈圈.而且你的"按住不放"这样的事件逻辑可以正常工作了.英文不是问题,大家自己看吧. 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

 

转载于:https://my.oschina.net/jinzei/blog/123607

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值