# define MIN(a,b) (((a)<(b)) ? (a) : (b))
#endif
+#ifdef WM_TOUCH
+ typedef BOOL (*pGetTouchInputInfo)(HTOUCHINPUT,UINT,PTOUCHINPUT,int);
+ typedef BOOL (*pCloseTouchInputHandle)(HTOUCHINPUT);
+ static pGetTouchInputInfo fghGetTouchInputInfo = (pGetTouchInputInfo)0xDEADBEEF;
+ static pCloseTouchInputHandle fghCloseTouchInputHandle = (pCloseTouchInputHandle)0xDEADBEEF;
+#endif
/*
* TODO BEFORE THE STABLE RELEASE:
unsigned int numInputs = (unsigned int)wParam;
unsigned int i = 0;
TOUCHINPUT* ti = (TOUCHINPUT*)malloc( sizeof(TOUCHINPUT)*numInputs);
- if (GetTouchInputInfo( (HTOUCHINPUT)lParam, numInputs, ti, sizeof(TOUCHINPUT) )) {
+
+ if (fghGetTouchInputInfo == (pGetTouchInputInfo)0xDEADBEEF) {
+ fghGetTouchInputInfo = (pGetTouchInputInfo)GetProcAddress(GetModuleHandle("user32"),"GetTouchInputInfo");
+ fghCloseTouchInputHandle = (pCloseTouchInputHandle)GetProcAddress(GetModuleHandle("user32"),"CloseTouchInputHandle");
+ }
+
+ if (!fghGetTouchInputInfo) {
+ free( (void*)ti );
+ break;
+ }
+
+ if (fghGetTouchInputInfo( (HTOUCHINPUT)lParam, numInputs, ti, sizeof(TOUCHINPUT) )) {
/* Handle each contact point */
for (i = 0; i < numInputs; ++i ) {
}
}
}
- CloseTouchInputHandle((HTOUCHINPUT)lParam);
+ fghCloseTouchInputHandle((HTOUCHINPUT)lParam);
free( (void*)ti );
lRet = 0; /*DefWindowProc( hWnd, uMsg, wParam, lParam );*/
break;
#endif /* TARGET_HOST_MS_WINDOWS */
+#ifdef WM_TOUCH
+ typedef BOOL (*pRegisterTouchWindow)(HWND,ULONG);
+ static pRegisterTouchWindow fghRegisterTouchWindow = (pRegisterTouchWindow)0xDEADBEEF;
+#endif
/* pushing attribute/value pairs into an array */
#define ATTRIB(a) attributes[where++]=(a)
/* Enable multitouch: additional flag TWF_FINETOUCH, TWF_WANTPALM */
#ifdef WM_TOUCH
- RegisterTouchWindow( window->Window.Handle, TWF_FINETOUCH | TWF_WANTPALM );
+ if (fghRegisterTouchWindow == (pRegisterTouchWindow)0xDEADBEEF)
+ fghRegisterTouchWindow = (pRegisterTouchWindow)GetProcAddress(GetModuleHandle("user32"),"RegisterTouchWindow");
+ if (fghRegisterTouchWindow)
+ fghRegisterTouchWindow( window->Window.Handle, TWF_FINETOUCH | TWF_WANTPALM );
#endif
#if defined(_WIN32_WCE)