Quantcast
Channel: Internet Explorer Web Development forum
Viewing all articles
Browse latest Browse all 3527

Only getting subset of WM_GESTURE events in web browser control

$
0
0

I'm trying to listen for gestures (both WM_GESTURE and WM_GESTURENOTIFY) on the webbrowser control we use in our product via an ATL Message Map . Both events are being fired when performingsome gestures on a touch screen, but when examining the lParam via GetGestureInfo, only a subset of possible gestures  are getting through to our control (we always get GID_BEGIN, GID_END, and these: GID_ROTATE, GID_PRESSANDTAP). GID_ZOOM, GID_PAN and GID_TWOFINGERTAP never make it to our events handlers, I believe IE or the OS is intercepting these gestures before they get to us. 

In Spy++ I watched the messages that come through for each window in the hierarchy of our application. The only window which got the individual missing messages was the bottom one in the hierarchy (Internet Explorer_Server). The other windows only show GID_BEGIN and GID_END for the missing gestures, which is what we are seeing in our code too. Is there a way we can listen for events on this window, or stop them being handled by the browser so that they bubble up to our webbrowser control?

LRESULT CHSCWindowView::OnGestureMessage(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL&)
{

	LOG_MESSAGE_FUN(L" CHSCWindowView::OnGestureMessage THE WPARAM IS = %d", wParam);

	GESTUREINFO gi;
	ZeroMemory(&gi, sizeof(GESTUREINFO));
	gi.cbSize = sizeof(GESTUREINFO);
	BOOL bResult = GetGestureInfo((HGESTUREINFO)(lParam), &gi);
	if (!bResult)
	{
		DWORD err = GetLastError();
		LOG_MESSAGE_FUN(L" CHSCWindowView::OnGestureMessage GetGestureInfo didnt work %d", err);
	}
	else
	{
		LOG_MESSAGE_FUN(L" CHSCWindowView::OnGestureMessage Got gesture info, gi.dwID = %d", gi.dwID);
		switch (gi.dwID)
		{

		case GID_TWOFINGERTAP:
		{
			// Code for two-finger tap goes here
			LOG_MESSAGE_FUN(L" CHSCWindowView::OnGestureMessage GID_TWOFINGERTAP");
			RETURN(TRUE);

		}
		}
	}
	RETURN(DefWindowProcA(m_hWnd, uMsg, wParam, lParam));
}


LRESULT CHSCWindowView::OnGestureNotify(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL&)
{
	// set the settings in the gesture configuration
	GESTURECONFIG gc[] = { { GID_ZOOM, GC_ZOOM, 0 },
	{ GID_ROTATE, GC_ROTATE, 0 },
	{ GID_PAN, GC_PAN, 0 },
	{ GID_TWOFINGERTAP, GC_TWOFINGERTAP, 0 },
	{ GID_PRESSANDTAP, GC_PRESSANDTAP, 0 }
	};


	UINT uiGcs = 5;
	BOOL bResult = SetGestureConfig(m_hWnd, 0, uiGcs, gc, sizeof(GESTURECONFIG));

	if (!bResult){
		DWORD err = GetLastError();
		LOG_MESSAGE_FUN(L" CHSCWindowView::OnGestureNotify GetGestureInfo didnt work %d", err);
	}

	return DefWindowProcA(m_hWnd, WM_GESTURENOTIFY, wParam, lParam);
}


Viewing all articles
Browse latest Browse all 3527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>