1

We are working with a Winforms application hosting a WebBrowser control which is running on Windows 7 machine with touch screen. The problem is when the user touches a button, the button would not look pressed down (the button works though). I read about this weird behavior from a devblogs post (https://devblogs.microsoft.com/oldnewthing/20170227-00/?p=95585) that this behavior is by design and it can be fixed by:

  1. Disabling the press-and-hold.
  2. Disabling all gestures (for Windows 7 and up)

Since we are targetting Windows 7 we need to apply both solutions above. It works but the problem is since all gestures will be disabled, the user cannot do any multitouch gestures anymore. We tried only the first solution (to just disable press-and-hold) but it won't do (mouse events still come after releasing the finger).

I've read similar questions about with this problem but the ones with answers were using Windows 8 and above where they disable the FEATURE_NINPUT_LEGACYMODE but this does not work with Windows 7. Anyone have any idea on how to be able to support multitouch gestures in Windows 7 without the mousedown issue?

Additional Information:

I saw another question (Windows 7 Touch Screen + Java Swing = Delayed Mouse Events) which I think is very similar but unfortunately there is no solution. But since it was asked around 7 years ago, without any updates, could there be perhaps someone who found a solution now? (or possibly not since it's too old already)

If this is problem is really a hardware/OS limitation, then I guess we have no choice but to accept this limitation.

Uwe Keim
  • 39,551
  • 56
  • 175
  • 291
  • It's not clear how you setup this application to handle touch input. Read the documentation related to example section of [Windows Touch Samples](https://learn.microsoft.com/en-us/windows/win32/wintouch/windows-touch-samples). The relevant examples are [MTScratchpadWMTouch](https://github.com/microsoft/Windows-classic-samples/tree/master/Samples/Win7Samples/Touch/MTScratchpadWMTouch/CS) (implement `RegisterTouchWindow()`, `GetTouchInputInfo()`, `CloseTouchInputHandle()` and handle `WM_TOUCH` messages), [...] – Jimi May 28 '21 at 12:43
  • [...] then [MTGestures](https://github.com/microsoft/Windows-classic-samples/tree/master/Samples/Win7Samples/Touch/MTGestures/CS) (implement `SetGestureConfig()`, `GetGestureInfo()`, `CloseGestureInfoHandle()`, and handle `WM_GESTURENOTIFY`, `WM_GESTURE` etc.) -- Handling Gestures and Touch notification, you have the chance to alter the state of a Control, to reflect a specific gesture/touch input in a custom way, if necessary. – Jimi May 28 '21 at 12:43
  • Does this answer your question? [WM\_TOUCH is not immediately sent with touch down event](https://stackoverflow.com/questions/7560334/wm-touch-is-not-immediately-sent-with-touch-down-event) – Loathing May 29 '21 at 03:52
  • @Jimi the application is a custom browser using WebBrowser control to display html. We just used SetGestureConfig to enable (or disable) all gestures (I just discovered gestures work with the WebBrowser control by default even if we don't use SetGestureConfig). edit: Sorry I pressend enter by accident. I tried RegisterTouchWIndow and the button issue was solved, however it seems like gestures do not work anymore (can't do pinch to zoom). I haven't studied much about this one but it looks like the pinch and other gestures need to be coded for them to work if I use this. – Kiyoshi Nakano May 31 '21 at 01:14
  • Yes, well, if you call `RegisterTouchWindow()`, you no longer receive `WM_GESTURE` messages. These are mutually exclusive, as clearly described in the Docs: [Getting Started with Windows Touch Gestures](https://learn.microsoft.com/en-us/windows/win32/wintouch/getting-started-with-multi-touch-gestures) (in the `Note` box). If you have tested the examples I linked, you'll see the same setup. – Jimi May 31 '21 at 01:30
  • @Jimi Thanks for the links. If I have to go with `RegisterTouchWindow` it seems like the application needs to be rewritten to support gestures. I also noticed that the examples are for forms, but our application is a form using a WebBrowser control where the user performs the gestures, so we maybe need to change the behavior of the WebBrowser control if it is possible. The `RegisterTouchWindow` does solve half of the problem with the buttons so I'll consider this as partial solution. I will come back to this if we finally solve it since currently it is not prioritized anymore. Thanks. – Kiyoshi Nakano May 31 '21 at 02:13

0 Answers0