Does anyone have a simple example for using the procedure WndProc callback in Xojo? I have written a win32 program in C++ on Windows that works well with gestures, and I can’t seem to figure out how to initiate the callback to determine the gestures recorded from touching the screen.
If someone has a simple example program (doesn’t need to include gesture commands), then I can convert the C++ code to Xojo.
Here is an example of the C++ code.
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
int wmId;
PAINTSTRUCT ps;
HDC hdc;
switch (message)
{
case WM_GESTURENOTIFY:
{
OutputDebugStringA("WM_GESTURENOTIFY\n");
GESTURECONFIG gc = {
0, // gesture ID
GC_ALLGESTURES, // settings related to gesture ID that are to be
// turned on
0 // settings related to gesture ID that are to be
// turned off
};
BOOL bResult = SetGestureConfig(
hWnd, // window for which configuration is specified
0, // reserved, must be 0
1, // count of GESTURECONFIG structures
&gc, // array of GESTURECONFIG structures, dwIDs will be processed in the
// order specified and repeated occurances will overwrite previous ones
sizeof(GESTURECONFIG) // sizeof(GESTURECONFIG)
);
if (!bResult)
{
ASSERT(L"Error in execution of SetGestureConfig" && 0);
}
}
break;
case WM_GESTURE:
OutputDebugStringA("WM_GESTURE\n");
return g_cGestureEngine.WndProc(hWnd,wParam,lParam);
break;
case WM_SIZE:
OutputDebugStringA("WM_SIZE\n");
g_cRect.ResetObject(LOWORD(lParam),HIWORD(lParam));
break;
case WM_COMMAND:
OutputDebugStringA("WM_COMMAND\n");
wmId = LOWORD(wParam);
switch (wmId)
{
case IDM_EXIT:
DestroyWindow(hWnd);
break;
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
break;
case WM_PAINT:
hdc = BeginPaint(hWnd, &ps);
g_cRect.Paint(hdc);
EndPaint(hWnd, &ps);
break;
case WM_DESTROY:
OutputDebugStringA("DESTROY\n");
PostQuitMessage(0);
break;
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
return 0;
}
Thanks for your help.