locked
Cannot receive WM_TOUCHMOVE messages RRS feed

  • Question

  • Hello,

    I am currently trying to receive WM_TOUCHMOVE messages instead of the default WM_GESTURE messages, so i called the function RegisterTouchWindow(hwnd,0);
    but, even if IsTouchWindow(hwnd,0) tells me i effectively registered my window to receive touch messages (result is ok if i called RegisterTouchWindow(hwnd,0); and ko if i didn't) , i continue to receive WM_GESTURE and i still don't have the messages i'd like to get.
    Could it be linked to the fact that the window is created in another framework ?

    Here is the relevant part of my code :

    typedef BOOL (__stdcall *RegisterTouchWindow_M)(HWND, ULONG); 
    typedef BOOL (__stdcall *IsTouchWindow_M)(HWND,PULONG);


    void TouchableWindow(){
    RegisterTouchWindow_M RegisterTouchWindow_R;
    HMODULE hMod = LoadLibrary(_T("User32.dll"));
    RegisterTouchWindow_R = (RegisterTouchWindow_M) GetProcAddress(hMod, "RegisterTouchWindow");
    lpfnOldWndProc = (WNDPROC)SetWindowLong(hwnd,
    GWL_WNDPROC, (DWORD) SubClassFunc);
    RegisterTouchWindow_R(hwnd,0);
    IsTouchWindow_M IsTouchWindow_R;
    IsTouchWindow_R = (IsTouchWindow_M) GetProcAddress(hMod, "IsTouchWindow");
    if(IsTouchWindow_R(hwnd,0)){
    printf("touchable status ok\n");}
    else{printf("touchable KO\n");}
    }



    LRESULT FAR PASCAL SubClassFunc( HWND hWnd,
    UINT Message,
    WPARAM wParam,
    LPARAM lParam)
    {
    //printf("%d\n",Message);
    switch (Message)
    {
    case 0x0240 : //WM_TOUCHMOVE
    //OnTouchMove(wParam,lParam);
    printf("TOUCHMOVE\n");
    break;
    case 0x0119: //WM_GESTURE:
    printf("GESTURE\n");
    break;
    default:
    return CallWindowProc(lpfnOldWndProc, hWnd, Message, wParam,
    lParam);

    }
    return CallWindowProc(lpfnOldWndProc, hWnd, Message, wParam,
    lParam);


    }


    Could anyone explain me what's wrong ?


    Monday, May 11, 2009 12:45 PM

All replies

  • I identified my own problem... i am posting here just in case there are people searching for nothing ;)
    The problem was the RegisterTouchWindow function doesn't register the child windows, so i was receiving Touchmove events only in the title/menu bar, and not in the "main view" of the window.
    Wednesday, May 13, 2009 9:14 AM