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

前端 未结 3 1551
一个人的身影
一个人的身影 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:47

    I was also looking for the solution to hide the small keyboard icon (SIP icon) and I achieved this by using the FindWindowW and MoveWindow or SetWindowPos functions of coredll.dll and user32.dll

    Declare the function we are interested in:

        [DllImport("coredll.dll", EntryPoint = "FindWindowW", SetLastError = true)]
        private static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
    
        [DllImport("coredll.dll", SetLastError = true)]
        [return: MarshalAs(UnmanagedType.Bool)]
        private static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int x, int y, int cx, int cy, uint uFlags);
    

    Then find the handle to keyboard icon and call the SetWindowPos to hide it:

    IntPtr hWnd = FindWindow(Nothing, "MS_SIPBUTTON");
    SetWindowPos(hWnd, 1, 0, 0, 0, 0, &H80);
    

    Useful links:

    1. P/Invoke - coredll.dll
    2. Disable keyboard icon in Windows Mobile using VB.net
    3. Manage SIP - skip to the bottom on this post and look for comments of user name Mark

    EDIT

    I had to modify this slightly to compile.

        const int SWP_HIDE = 0x0080;
        IntPtr hWnd = FindWindow(null, "MS_SIPBUTTON");
        SetWindowPos(hWnd, IntPtr.Zero, 0, 0, 0, 0, SWP_HIDE);
    

提交回复
热议问题