none
Ignore gestures on Windows Mobile 6.5 in C# application

    問題

  • We have an old application (C#, Compact Framework 2.0) that has been running on Motorola MC70 mobile computers (running Windows Mobile 5.0) for a few years. Since Motorola does not manufacture this model anymore, we are in the process of replacing it with Motorola MC75A. The problem is that MC75A is only available with Windows Mobile 6.5.

    When adjusting our application to the MC75A, we found out that almost everything works OK, but we found a showstopper: gestures. The problem is that on a few forms, there are a few tabcontrols where we control in code which tab that is supposed to be shown (bad idea, I know, but I have inherited this application from another vendor) and the gestures interfere with this since a quick gesture to the left (whihc user user to select text in a textbox) will make a new tab to be shown.

    So we are currently looking into how to workaround this. The best solution would probably be to rewrite tha application to not use tabs since it is not really a tab control, but because of time and budget contraints, we would rather want to disable gestures completely.

    So, is it possible to disable gestures completely either application wide or at least for a specific control?

    2011年8月24日 上午 09:29

所有回覆

  • Maybe there is no easy way, you need to inherit that control and overload the callback function.
    NEU_ShieldEdge
    2011年8月26日 上午 06:56
  • What do You mean by "overload the callback function" ? Igues it would be possible to inherit the control and override the message pump to ignore these messages if I was using C++, but as far as I know this is not possible in C# on Compact .NEt Framework.

    Can you give more information about how to proceed?

    2011年9月1日 上午 09:01
  • What do You mean by "overload the callback function" ? Igues it would be possible to inherit the control and override the message pump to ignore these messages if I was using C++, but as far as I know this is not possible in C# on Compact .NEt Framework.

    Can you give more information about how to proceed?

    Same problem here :/

    Any sugestions? workarounds?

    2012年11月16日 下午 06:20
  • I have also this problem (and also with the Motorola Terminal). On one tab I have a field for the customer to sign; sometime this ends with a tab change.

    The only but stupid solution I found until now: blocking tab changes generaly by catching the SelectedIndexChange event and to set the preveous tab there. But this means to have an extra button to enable and disable this mechanism.

    Winfried

    2012年11月22日 上午 08:28
  • If you have access to the BSP cant you just re-build it and remove the gestures component?
    2013年3月26日 上午 08:18
  • Hello,

    Why don't use "DisableGestures" function from coredll.dll ?

    [DllImport("coredll.dll")] private static extern bool DisableGestures(IntPtr p_ipHwnd, UInt64 p_uiTGFflags, uint p_uiScope);

    private const UInt64 TGF_GID_BEGIN        = 0x0000000000000002;
    private const UInt64 TGF_GID_END          = 0x0000000000000008;
    private const UInt64 TGF_GID_PAN          = 0x0000000000000100;
    private const UInt64 TGF_GID_ROTATE       = 0x0000000000000200;
    private const UInt64 TGF_GID_SCROLL       = 0x0000000000001000;
    private const UInt64 TGF_GID_HOLD         = 0x0000000000002000;
    private const UInt64 TGF_GID_SELECT       = 0x0000000000004000;
    private const UInt64 TGF_GID_DOUBLESELECT = 0x0000000000008000;
    private const UInt64 TGF_GID_LAST         = 0x0000000000008000;
    private const UInt64 TGF_GID_MAX          = 0x8000000000000000;
    private const UInt64 TGF_GID_ALL          = 0xFFFFFFFFFFFFFFFF;
    private const uint TGF_SCOPE_WINDOW = 0x0000; private const uint TGF_SCOPE_PROCESS = 0x0001; public frmMain() { InitializeComponent();

    DisableGestures(null, TGF_GID_ALL, TGF_SCOPE_PROCESS); }

    You can also try to disable gestures for only one window.


    • 已提議為解答 JGrady 2014年3月13日 下午 01:13
    2014年2月26日 下午 04:08
  • This worked great for me.  Thanks very much for the information.  I did have to use "IntPtr.Zero" instead of null in the call to DisableGestures.

    2014年3月13日 下午 01:12