Tech Off Thread

4 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

WM_GESTURECOMMAND on Windows 7

Back to Forum: Tech Off
  • User profile image
    jpkleinau

    I am using Windows 7 PreBeta (Build 6801) on a HP TouchSmart IQ810 System. I try to use the multi-touch functionality and the gestures, but I don't get any WM_GESTURECOMMAND messages.

     

    I get the WM_TOUCH messages, but only for one finger (no multitouch). The current multi touch driver (NextWindow V1.0.3.4) is installed.

     

    I need some help. Is there anything I am doing wrong?



    Here is my Test app code:

     

        public partial class Form1 : Form

        {

            [DllImport("user32", EntryPoint = "RegisterGestureHandlerWindow")]

            public static extern int RegisterGestureHandlerWindow(IntPtr hwnd, uint flags);

     

            [DllImport("user32", EntryPoint = "RegisterTouchWindow")]

            public static extern int RegisterTouchWindow(IntPtr hwnd, uint flags);

     

            public Form1()

            {

                InitializeComponent();

                 RegisterTouchWindow(Handle, 0);

                RegisterGestureHandlerWindow(Handle, 0);    

            }

     

            protected override void WndProc(ref Message m)

            {

                switch (m.Msg)

                {

                    // WM_GESTURECOMMAND

                    case 0x0119:

                        Trace.WriteLine("Gesture");

                        break;

     

                    // WM_TOUCHDOWN

                    case 0x0241:

                        Trace.WriteLine("TouchDown");

                        break;

     

                    // WM_TOUCHUP

                    case 0x0242:

                        Trace.WriteLine("TouchUp");

                        break;

                 }

                base.WndProc(ref m);

            }

       }

     

  • User profile image
    jh71283

    You may already know it, but the hardware has to explicitly support multitouch also.

    Most touchscreens are single touch at the moment.

  • User profile image
    jpkleinau

    jh71283 said:
    You may already know it, but the hardware has to explicitly support multitouch also.

    Most touchscreens are single touch at the moment.
    I do know. And I do now know the reason why. the multitouch is blocked in the 6801 Build. There is an unlock patch for 32bit at Rafael Rivera's Blog Within Windows. Use it at your own risk Wink

  • User profile image
    gillsr

    Hello, I'm trying to write a simple application that listens for WM_gesture messages in c# but don't have the PDC examples. I have got as far as (important snippets):

    [DllImport("user32")]
    [return: MarshalAs(UnmanagedType.Bool)]
    private static extern bool GetGestureInfo(System.IntPtr hGestureInfo, [Out] GESTUREINFO pGestureInfo);


    private struct GESTUREINFO
    {
    public int cbSize;
    public int dwFlags;
    public int dwID;
    public System.IntPtr hwndTarget;
    public POINTS ptsLocation;
    public int dwInstanceID;
    public int dwSequenceID;
    public ulong ullArguments;
    public int cbExtraArgs;}

    GESTUREINFO gi = new GESTUREINFO();
    gi.cbSize = Marshal.SizeOf(gi);
    gi.dwFlags = 0;
    gi.ptsLocation.x = 0;
    gi.ptsLocation.y = 0;
    gi.dwID = 0;
    gi.dwInstanceID = 0;
    gi.dwSequenceID = 0;

    try
    {
    bResult = GetGestureInfo(m.LParam, gi);
    }
    catch (Exception)
    {
    throw;
    }

    But always get:
    Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
    on the GetgestureInfo call

    Anyone have any advice?

    (Running Dell XT & ntrig multitouch driver on Win7 public beta)

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.