Thanks for your feedback,
I updated my GetPointerDevices stub to return FALSE when the application tries to load devices - now we only success if it queries the number of devices - and then we return 0. This should be alright.
I made a small testcase to test if windows returns success for RegisterTouchHitTestingWindow when the system doesn't have a pointer device - it does. Since there is no touch device, it should be fine if we just never send the message - even if the window is "registered".
I'd add a testcase, but I'm not sure how to go about that - since it's not guaranteed that every machine the test runs one has 0 pointer devices. An idea how I could go about that?
Regards, Fabian Maurer
#################################### #define _WIN32_WINNT _WIN32_WINNT_WIN8 #include <windows.h> #include <stdio.h>
static LRESULT WINAPI WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { return DefWindowProcA(hwnd, message, wParam, lParam); }
int main(void) { BOOL success; UINT32 count; WNDCLASSA cls = {0}; HANDLE hwnd; POINTER_DEVICE_INFO devices[1];
cls.lpfnWndProc = WndProc; cls.hInstance = GetModuleHandleA(0); cls.hCursor = LoadCursorA(0, (LPCSTR)IDC_ARROW); cls.hbrBackground = GetStockObject(WHITE_BRUSH); cls.lpszClassName = "testclass"; RegisterClassA(&cls);
hwnd = CreateWindowA("testclass", "Test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, 10, 10, 300, 300, NULL, NULL, NULL, 0); printf("Handle: %p\n", hwnd);
success = GetPointerDevices(&count, NULL); printf("success: %d, count: %d\n", success, count);
success = RegisterTouchHitTestingWindow(hwnd, TOUCH_HIT_TESTING_CLIENT); printf("success: %d\n", success);
count = 1; success = GetPointerDevices(&count, devices); printf("success: %d, count: %d\n", success, count);
return 0; }
#################################### output from testbot: Handle: 00070234 success: 1, count: 0 success: 1 success: 0, count: 1