This can be done by manipulating the flag set MICROSOFT_TABLETPENSERVICE_PROPERTY.
#include <tpcshrd.h>
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) {
const DWORD_PTR dwHwndTabletProperty =
TABLET_DISABLE_PRESSANDHOLD |
TABLET_DISABLE_PENTAPFEEDBACK |
TABLET_DISABLE_PENBARRELFEEDBACK |
TABLET_DISABLE_FLICKS;
ATOM atom = GlobalAddAtom(MICROSOFT_TABLETPENSERVICE_PROPERTY);
SetProp(hWnd, MICROSOFT_TABLETPENSERVICE_PROPERTY, reinterpret_cast (dwHwndTabletProperty));
GlobalDeleteAtom(atom);
}
(I do not take loans for this, soure )
An important parameter is the hWnd handle, which you pass to SetProp. GetDesktopWindow returns a handle to the desktop window. Setting this for the desktop should deactivate it for all windows on the desktop and on the desktop. Please note, however, that this will not be a permanent change (a reboot will cancel it).
Possible values โโyou can use:
#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
(http://msdn.microsoft.com/en-us/library/bb969148%28VS.85%29.aspx)