none
How to get the Gesture events in c# Embedded Compact 7 application? RRS feed

  • Question

  • Hi all,

           I am looking the Gesture Recognizer in c# with embedded compact 7 application. please tell me some ideas.

     

    Thanks and Regards,

    Vinothkumar.A


    vinothkumar.A
    Monday, May 23, 2011 11:09 AM

All replies

  • I got the solution for my posted question. This is the solution.

     

    [DllImport("coredll.dll", SetLastError = true)]
            public static extern bool EnableGestures(IntPtr hwnd, UInt64 TGFflags, uint scope);

            public const UInt64 TGF_GID_BEGIN = 0x0000000000000002;
            public const UInt64 TGF_GID_END = 0x0000000000000008;
            public const UInt64 TGF_GID_PAN = 0x0000000000000100;
            public const UInt64 TGF_GID_ROTATE = 0x0000000000000200;
            public const UInt64 TGF_GID_SCROLL = 0x0000000000001000;
            public const UInt64 TGF_GID_HOLD = 0x0000000000002000;
            public const UInt64 TGF_GID_SELECT = 0x0000000000004000;
            public const UInt64 TGF_GID_DOUBLESELECT = 0x0000000000008000;
            public const UInt64 TGF_GID_LAST = 0x0000000000008000;
            public const UInt64 TGF_GID_MAX = 0x8000000000000000;

            public const uint TGF_SCOPE_WINDOW = 0;
            public const uint TGF_SCOPE_PROCESS = 1;

            public static void ActivateGestureAll(IntPtr handle)
            {
                try
                {
                    EnableGestures(handle, TGF_GID_BEGIN, TGF_SCOPE_PROCESS);
                    EnableGestures(handle, TGF_GID_DOUBLESELECT, TGF_SCOPE_PROCESS);
                    EnableGestures(handle, TGF_GID_END, TGF_SCOPE_PROCESS);
                    EnableGestures(handle, TGF_GID_LAST, TGF_SCOPE_PROCESS);
                    EnableGestures(handle, TGF_GID_MAX, TGF_SCOPE_PROCESS);
                    EnableGestures(handle, TGF_GID_PAN, TGF_SCOPE_PROCESS);
                    EnableGestures(handle, TGF_GID_ROTATE, TGF_SCOPE_PROCESS);
                    EnableGestures(handle, TGF_GID_SCROLL, TGF_SCOPE_PROCESS);
                    EnableGestures(handle, TGF_GID_HOLD, TGF_SCOPE_PROCESS);
                    EnableGestures(handle, TGF_GID_SELECT, TGF_SCOPE_PROCESS);
                }
                catch (Exception ex)
                {
                    System.Windows.Forms.MessageBox.Show(ex.Message);
                }
            }

     

    After this we could get the events like the following event handlers.

    private void reg_Scroll(object sender, GestureScrollEventArgs e)
            {
                try
                {
                 
                    if (e.ScrollDirection == GestureScrollDirection.Right)
                    {
                     
                    }
                    else if (e.ScrollDirection == GestureScrollDirection.Left)
                    {

                    }

              }

     catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }

    }


    vinothkumar.A
    Tuesday, May 24, 2011 11:10 AM