How to listen for touch gesture in MFC application?

  • Thread starter Thread starter IqbalShajol
  • Start date Start date
I

IqbalShajol

Guest
Hello,

Hope you guys doing great. I have a full screen MFC application and using Visual Studio 2008. When it's full screen I want to catch the "flick from top edge" gesture from my application. What I have found so far is, there is a windows message WM_TABLET_FLICK.

According to Windows Dev Center, When a pen flick occurs, Windows first notifies an application by sending a WM_TABLET_FLICK message, which a window receives through its WindowProc function.


I tried to implement the WindowProc method like below-

In the header, I added,

LRESULT CALLBACK WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);

In the cpp file, I added,

LRESULT CALLBACK MyApp::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
//"[WindowProc] callback detected."

switch( uMsg )
{
case WM_TABLET_FLICK:
{
//"[WindowProc] Tablet Flick detected."
FLICK_POINT pt = (FLICK_POINT&) lParam;
//Do something..
}
}
return DefWindowProc(uMsg, wParam, lParam);
}


But, it's not working. Please guide me how to make this work? Or, in which approach I should try to detect the touch gesture?


Thanks in advance.

Continue reading...
 
Back
Top