How can I hide the little keyboard popup in Windows Mobile 6.5? (c#)

前端 未结 3 1594
一个人的身影
一个人的身影 2021-01-23 02:52

I have an app that is essentially a wizard that goes through some dialog boxes. One of the forms has just a button on it that brings up the common \"take picture\" dialog.

3条回答
  •  天命终不由人
    2021-01-23 03:34

    This answer was taken from the following article http://beemobile4.net/support/technical-articles/windows-mobile-programming-tricks-on-net-compact-framework-12 (I have only added the using statements). I'm on Windows Mobile 6.1 Classic, .NET CF 3.5.

    using System;
    using System.Runtime.InteropServices;
    
    [DllImport("coredll.dll", SetLastError = true)]
    private static extern IntPtr FindWindow(string caption, string className);
    
    [DllImport("coredll.dll", SetLastError = true)]
    private static extern bool ShowWindow(IntPtr hwnd, int state);
    
    [DllImport("coredll.dll")]
    private static extern IntPtr GetWindow(IntPtr hWnd, uint uCmd);
    
    private const int SW_HIDE = 0;
    private const int SW_SHOW = 1;
    private const int GW_CHILD = 5;
    
    ///         
    /// Shows the SIP (Software Input Panel) button.        
    ///
    static public void ShowHideSIP(int nShowOrHide)
    {
        IntPtr hSipWindow = FindWindow("MS_SIPBUTTON", "MS_SIPBUTTON");
        if (hSipWindow != IntPtr.Zero)
        {
            IntPtr hSipButton = GetWindow(hSipWindow, GW_CHILD);
            if (hSipButton != IntPtr.Zero)
            {
                bool res = ShowWindow(hSipButton, nShowOrHide);
            }
        }
    }
    

提交回复
热议问题