Click here to Skip to main content
15,880,469 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi All,

I am capturing the count of PointerDown and PointerUp touch events, using global hook 'WH_GETMESSAGE'. For every PointerDown touch, I am supposed to get one PointerUp touch. But in case of touch events inside google chrome or firefox, I am getting 2 pointerUp events for 1 pointerDown event. Any idea why? Also, is there any way to know if I am touching a google chrome window or a firefox

What I have tried:

C++
LRESULT CALLBACK GetMsgProc(int nCode, WPARAM wParam, LPARAM lParam)
{
	LPMSG lpMsg = (LPMSG)lParam;
	UINT32 pointerId = GET_POINTERID_WPARAM(lpMsg->wParam);
	switch (lpMsg->message)
	{
	case WM_POINTERDOWN:
		POINTER_INPUT_TYPE pointerType;
		GetPointerType(pointerId, &pointerType);
                if (pointerType == PT_TOUCH)
			OutputDebugString(TEXT("Hook: PointerDown Touch"));
                return CallNextHookEx(NULL, nCode, wParam, lParam);

	case WM_POINTERUP:
		POINTER_INPUT_TYPE pointerTypeUp;
		GetPointerType(pointerId, &pointerTypeUp);
		if (pointerTypeUp == PT_TOUCH)
			OutputDebugString(TEXT("Hook: PointerUp Touch"));
                return CallNextHookEx(NULL, nCode, wParam, lParam);
	}
	return CallNextHookEx(NULL, nCode, wParam, lParam);
}
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900