Troubleshooting Applications
This section gives solutions to common problems.
General Troubleshooting
Category | Description |
---|---|
Issue | I am running Windows Server 2008 and Windows Touch features are not working. |
Cause | You haven't enabled the Desktop Experience. |
Solution | Open the Server Manager administrative tool: click Start, point to Administrative Tools, and then click Server Manager. Click the Features item in the left column. Click Add Features in the Features section. Select Desktop Experience, click Next, and then click Install. |
Category | Description |
---|---|
Issue | Whenever I move my finger quickly across my application, an arrow appears and my gesture or manipulation is not registering correctly. |
Cause | Having flicks enabled when you don't need it. |
Solution | You have flicks enabled when you want it to be disabled. See Legacy Support for Panning with Scrollbars for information on disabling pen flicks. |
Issue | I can't discern between mouse input and Windows Touch input. | ||
Cause | Windows generates mouse messages for legacy support when a user clicks on the screen. | ||
Solution | You can call GetMessageExtraInfo for the WM_LBUTTONDOWN and WM_LBUTTONUP messages to determine the source. The following code shows how this could be done.
|
Category | Description |
---|---|
Issue | How do I run Microsoft PixelSense applications on Windows 7? |
Cause | Windows Touch and Microsoft PixelSense are incompatible. |
Solution | You either need to target the Windows 7 platform or Microsoft PixelSense platform. |
Troubleshooting Manipulations and Inertia
Category | Description |
---|---|
Issue | My application is freezing for no reason. I'm getting access violations when I initialize my object interfaces. |
Cause | Missing a call to CoInitialize when using the IManipulationProcessor or IInertiaProcessor interfaces. |
Solution | This could be caused by instantiating the Windows Touch Component Object Model (COM) objects without calling CoInitialize. This happens sometimes when you are converting projects from using gestures to using the manipulations or inertia interfaces. |
Category | Description |
---|---|
Issue | My object is rotating improperly when it's being translated. Single-finger rotation is not working correctly. |
Cause | Improperly setting pivots on an object. |
Solution | You are not setting up the manipulation pivot points correctly. Set the PivotPointX and PivotPointY properties to the center of the object or point you want to rotate around, and set the PivotRadius property to the radius of your object. |
Troubleshooting Windows Touch Input
Category | Description |
---|---|
Issue | After I handle the WM_TOUCH message, I stop getting boundary feedback. |
Cause | Consuming the WM_TOUCH message without handling it. |
Solution | You are probably consuming a Windows Touch message without forwarding it to DefWindowProc, which will result in unexpected behavior. Check Getting Started with Windows Touch Messages for more information on how to properly handle WM_TOUCH messages. |
Issue | I am including windows.h, but it still says that WM_TOUCH is not defined. | ||
Cause | The Windows version in Targetver.h is incorrect. | ||
Solution | You haven't set the correct Windows version in your project. The following code illustrates the properly set Windows versions for Windows Touch in Windows 7.
|
Issue | My touch input x-coordinates and y-coordinates seem invalid. They are either larger values than I expect or they are negative values. | ||
Cause | You may need to convert your touch points to pixels, or you may need to convert the screen coordinates. | ||
Solution | Make sure that you are calling TOUCH_COORD_TO_PIXEL and ScreenToClient. The following code shows how to do this.
Note: |
Category | Description |
---|---|
Issue | I'm not seeing WM_TOUCH messages, but I know that Windows Touch is working because I'm seeing WM_GESTURE messages. |
Cause | Missing a call to RegisterTouchWindow. |
Solution | WM_TOUCH and WM_GESTURE messages are mutually exclusive. If you don't call RegisterTouchWindow, you will receive only WM_GESTURE messages. |
Category | Description |
---|---|
Issue | I am noticing small delays from the time I touch my finger down to when I am getting input in my application. |
Cause | Palm rejection is causing delays in input. |
Solution | If TWF_WANTPALM is set in calls to RegisterTouchWindow, palm rejection is enabled. This causes a small (100 ms) delay while the software tests whether input is coming from a finger, pen, or the user's palm. Disable palm rejection by calling RegisterTouchWindow with the TWF_WANTPALM flag cleared. |
Troubleshooting Windows Touch Gestures
Category | Description |
---|---|
Issue | After handling the WM_GESTURE message, I stop getting boundary feedback. Or, a gesture that worked previously does not work now. |
Cause | Consuming the WM_GESTURE message without handling it. |
Solution | You are probably consuming a Windows Touch message without forwarding it to DefWindowProc, which will result in unexpected behavior. Check Getting Started with Windows Gestures for more information on how to properly handle WM_GESTURE messages. |
Category | Description |
---|---|
Issue | I'm not seeing WM_GESTURE messages, but I know that Windows Touch is working because I'm seeing WM_TOUCH messages. |
Cause | Calling RegisterTouchWindow. |
Solution | WM_TOUCH and WM_GESTURE messages are mutually exclusive. If you call RegisterTouchWindow, you will not receive WM_GESTURE messages. |
Issue | I'm not seeing all of the gestures that I expect to see. For example, I'm seeing gestures with the identifier GID_PAN but not GID_ROTATE. | ||
Cause | Some gestures, such as the rotate gesture, are not enabled by default. | ||
Solution | You need to call SetGestureConfig when you receive a WM_GESTURENOTIFY message as described in the WM_GESTURENOTIFY reference, or you need to add a handler for the WM_GESTURENOTIFY message. The following code shows how a handler could be implemented to enable support for rotation.
For more examples of typical gesture configurations, see SetGestureConfig. |
Category | Description |
---|---|
Issue | The custom scroll bars in my application are not scrolling when I perform the pan gesture. |
Cause | Missing handlers for the correct WM_*SCROLL messages. |
Solution | You are not handling all of the WM_*SCROLL messages in your custom scroll bars. It is recommended that you handle the WM_GESTURE message rather than retain custom scrollbar functionality through legacy support. You need to support messages as detailed in the section Legacy Support for Panning with Scroll bars. |
Category | Description |
---|---|
Issue | I am getting delays for gestures. |
Cause | Flicks may be causing delays for gestures. |
Solution | Flicks can cause delays for how long it takes for your application to receive WM_GESTURE messages. See Legacy Support for Panning with Scrollbars for information on disabling flicks. |
Related topics