

SetGestureConfig(hwnd, 0, 1, &config, sizeof(config)) But it doesn’t help for Windows 7 and above. This successfully disables the press-and-hold gesture on Tablet PC (remember that?), allowing the left-button messages to be generated immediately upon contact. The interesting part is adding a handler for the WM_TABLET_QUERYSYSTEMGESTURESTATUS message and responding that we want to disable press-and-hold. (Note that we divide cy by 2 in the OnSize function so that there is room at the bottom of the window for touch activity.)
#GIMPSHOP PRESS AND HOLD TABLET CODE#
Most of this code is just creating a logging window so we can see the message traffic. GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)) StringCchPrintf(buffer, 80, TEXT("%04x %d %d"), uiMsg, WndProc(HWND hwnd, UINT uiMsg, WPARAM wParam, LPARAM lParam) MoveWindow(g_hwndChild, 0, 0, cx, cy/2, TRUE) OnSize(HWND hwnd, UINT state, int cx, int cy) LBS_HASSTRINGS | WS_CHILD | WS_VISIBLE | WS_VSCROLL, G_hwndChild = CreateWindow(TEXT("listbox"), NULL, #include // WM_TABLET_QUERYSYSTEMGESTURESTATUS Take our scratch program and add the following: #include // StringCchPrintf The customer’s program was targeting Windows 7, so they were looking for solutions that would work on that platform. But if the finger does not remain in contact for a long time, then the touch events are converted to left-mouse-button messages ( WM_LBUTTONDOWN and WM_LBUTTONUP). If so, then the touch events are converted to right-mouse-button messages ( WM_RBUTTONDOWN and WM_RBUTTONUP). The system is waiting to see whether the user is making a press-and-hold gesture. They wanted to know whether this was by design, and also whether there was a way to get the WM_LBUTTONDOWN message as soon as the finger touches the screen. A customer had a program which responded to left mouse clicks, but they found that when used with a touch screen, when users touched the screen, the WM_LBUTTONDOWN message didn’t arrive until the users lifted their fingers from the screen.
