burak.io
(burak.io)
May 30, 2015, 7:51am
1
Hello,
I am currently working on a windows based project which is using windows messages such as WM_GESTURE, WM_TOUCH. Somehow I have to place my own code in
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
Callback function in order to analyze current user interrupts. But I couldn’t find any document about it.
For example:
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
int wmId, wmEvent;
PAINTSTRUCT ps;
HDC hdc;
switch (message)
{
// pass touch messages to the touch handler
case WM_TOUCH:
OnTouch(hWnd, wParam, lParam);
break;
Thank you for your help in advance.
burak.io
(burak.io)
May 30, 2015, 1:23pm
2
Hi! guys. Now, i want to add window message(ex. WM_USER + 200), and i want to insert command when windows are created. where can i add this message and insert command? please help me. UE4 version : 4.6.1 OS : Windows 7
This topic helped me to get through with the issue.
Hi,
I am not sure if this is already resolved completely but in order to enable the wm_touch and wm_gesture functionality there must be done some additional tasks:
WINVER must be set to minimum win7. that means in UEBuildWindows.cs the line must be
InBuildTarget.GlobalCompileEnvironment.Config.Definitions.Add(“WINVER=0x0601”);
Otherwise during the include of the winuser.h header the wm_touch and wm_gesture defines are not set.
the BOOL WINAPI RegisterTouchWindow(__in HWND hWnd, __in ULONG ulFlags) function must be called
I edited WindowsWindows.cpp in method FWindowsWindows::Initialize in line 155 under
ReshapeWindow(X, Y, ClientWidth, ClientHeight);
To use this thread How can i add window message? - Platform & Builds - Epic Developer Community Forums
You have to define the WM_TOUCH flags etc yourself because somehow the include of WinUser.h doesn’t work…
I simply used something like
#ifndef WM_TOUCH
#define WM_TOUCH 0x0240
#endif