none
Windows call to disable touch pointer RRS feed

  • Question

  •  

    I'm trying to disable the touch pointer feature on vista through a Windows application.  I saw some code to disable it through the WndProc using C#, but I was wondering if people could explain how to disable it using C++.  I tried to catch the message 731 in the PreTranslateMessage, but I don't see the message being sent...Can anybody point out if I'm doing something wrong?  Thank you.

    Friday, April 27, 2007 11:20 PM

Answers

  • Hi Fabio,

     

    please include tpcshrd.h in your C++ app and try the following code:

     

    LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
     {

     switch (message)
      {
      case WM_TABLET_QUERYSYSTEMGESTURESTATUS:
        return TABLET_DISABLE_TOUCHUIFORCEOFF;
        break;
    ...

    }

     

    The numeric value of the message you are handling here is 716 (not 731).

     

    Thanks,

    Stefan Wick

     

    Saturday, May 5, 2007 5:15 AM
  • Hi Fabio,

     

    Please be sure to include the latest tpcshrd.h that comes with the Windows Vista SDK from \Program Files\Microsoft SDKs\Windows\v6.0\Include. The one that shipped in the TabletPC SDK 1.7 does not have the relevant constants defined that you need here.

     

    Specifically, you want these definitions to figure out how to respond to WM_TABLET_QUERYSYSTEMGESTURE:

     

    #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

     Thanks,

    Stefan Wick

    Thursday, May 10, 2007 6:35 AM

All replies

  • Hi Fabio,

     

    please include tpcshrd.h in your C++ app and try the following code:

     

    LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
     {

     switch (message)
      {
      case WM_TABLET_QUERYSYSTEMGESTURESTATUS:
        return TABLET_DISABLE_TOUCHUIFORCEOFF;
        break;
    ...

    }

     

    The numeric value of the message you are handling here is 716 (not 731).

     

    Thanks,

    Stefan Wick

     

    Saturday, May 5, 2007 5:15 AM
  • Hi Stefan,

     

    I tried the code you suggested but I still couldn't get it to work.  Here's what I have done; maybe you can see what I'm doing wrong.  I'm not being able to compile because the two TABLET constants are not defined/found.  I included the tpcshrd.h just like you suggested.  The tpcshrd.h is found in the include folder of MS Tablet PC Pltaform SDK.

     

    I tried to define the constants myself this way:

    #if !defined WM_TABLET_QUERYSYSTEMGESTURESTATUS

    #define WM_TABLET_QUERYSYSTEMGESTURESTATUS 716

    #endif

    I'm using MFC so I created a message handler ON_MESSAGE( WM_TABLET_QUERYSYSTEMGESTURESTATUS, OnTouchPointer).  I can catch the message 716 in my message handler, but I'm still not sure what value to use to disable the touch pointer.

     

    Any help would be greatly appreciated!  Thanks!

     

    Fabio

    Thursday, May 10, 2007 4:09 AM
  • Hi Fabio,

     

    Please be sure to include the latest tpcshrd.h that comes with the Windows Vista SDK from \Program Files\Microsoft SDKs\Windows\v6.0\Include. The one that shipped in the TabletPC SDK 1.7 does not have the relevant constants defined that you need here.

     

    Specifically, you want these definitions to figure out how to respond to WM_TABLET_QUERYSYSTEMGESTURE:

     

    #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

     Thanks,

    Stefan Wick

    Thursday, May 10, 2007 6:35 AM
  • Stefan, Thank you very much. The touch pointer disables correctly!  (I had the wrong order of SDKs in my include directory..)  Fabio
    Thursday, May 10, 2007 5:13 PM
  • Hi,

     

    I think I spoke too soon about disabling the touch pointer for my application... now I can disable the touch pointer for a particular dialog that listens for that message, but how can I disable the touch pointer for every control in the application (using MFC)?  I have several controls, like CButton, CEdit, CDialog, is there a way of creating a "catch all" method to disable the touch pointer while the focus in on my application?

     

    I tried to use SetWindowsHookEx, to catch the message in my CWinApp (since it's threaded and I can't use the normal ON_MESSAGE that returns a LRESULT), but when a particular control gets a left button down, the CWinApp won't receive the message.

     

    Any suggestion would be greatly appreciated!  Thank you,

    Fabio

    Thursday, May 10, 2007 11:02 PM
  • I have the same issue,, how to globaly disable the touch pointer?
    Any hints found now?
    Thanks.

    -chueh8
    Tuesday, April 28, 2009 11:13 PM