HP TouchSmart 9100 Resources for Developing Touch-Friendly Applications for HP - Page 16

shows the states of the gesture: GID_BEGIN, GID_INERTIA or

Page 16 highlights

BOOL bResult = GetGestureInfo((HGESTUREINFO)lParam, &gi); BOOL bHandled = FALSE; if (bResult){ // now interpret the gesture switch (gi.dwID){ case GID_ZOOM: // Code for zooming goes here bHandled = TRUE; break; case GID_PAN: // Code for panning goes here bHandled = TRUE; break; case GID_ROTATE: // Code for rotation goes here bHandled = TRUE; break; case GID_TWOFINGERTAP: // Code for two-finger tap goes here bHandled = TRUE; break; case GID_PRESSANDTAP: // Code for roll over goes here bHandled = TRUE; break; default: // A gesture was not recognized break; } }else{ DWORD dwErr = GetLastError(); if (dwErr > 0){ //MessageBoxW(hWnd, L"Error!", L"Could not retrieve a GESTUREINFO structure.", MB_OK); } } if (bHandled){ return 0; }else{ return DefWindowProc(hWnd, message, wParam, lParam); } } The gesture information structure GESTUREINFO contains additional information that may be helpful to your application:  dwFlags shows the states of the gesture: GID_BEGIN, GID_INERTIA or GID_END.  pstLocation shows the location relating to the gesture (for example, pstLocation indicates the center of a zoom gesture) 16

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37

16
BOOL bResult
=
GetGestureInfo
((HGESTUREINFO)lParam, &gi);
BOOL bHandled = FALSE;
if (bResult){
// now interpret the gesture
switch (gi.
dwID
){
case GID_ZOOM:
// Code for zooming goes here
bHandled = TRUE;
break;
case GID_PAN:
// Code for panning goes here
bHandled = TRUE;
break;
case GID_ROTATE:
// Code for rotation goes here
bHandled = TRUE;
break;
case GID_TWOFINGERTAP:
// Code for two-finger tap goes here
bHandled = TRUE;
break;
case GID_PRESSANDTAP:
// Code for roll over goes here
bHandled = TRUE;
break;
default:
// A gesture was not recognized
break;
}
}else{
DWORD dwErr = GetLastError();
if (dwErr > 0){
//MessageBoxW(hWnd, L"Error!", L"Could not retrieve a
GESTUREINFO structure.", MB_OK);
}
}
if (bHandled){
return 0;
}else{
return
DefWindowProc
(hWnd, message, wParam, lParam);
}
}
The gesture information structure
GESTUREINFO
contains additional information that
may be helpful to your application:
dwFlags
shows the states of the gesture: GID_BEGIN, GID_INERTIA or
GID_END.
pstLocation
shows the location relating to the gesture (for example, pstLocation
indicates the center of a zoom gesture)