Search code examples
compact-framework

NETCF - Always on top form but SIP stays on top problem


how can I get rid of that SIP button in there? My form was supposed to be always on top, set via API SetWindowsPOS but that button still sits on top? Obviously, am not using any InputPanel as you can see there...


Solution

  • I am presuming the OS is Windows Mobile 6.5? Below is the code I use to disable the SIP button in 6.5:

    public static class SoftInputPanel
    {
        const uint SIPF_OFF = 0x0;
        const uint SIPF_ON = 0x1;
    
        [DllImport("aygshell.dll")]
        static extern uint SHFullScreen(IntPtr hwndRequester, uint dwState);
        private const uint SHFS_HIDESIPBUTTON = 0x0008;
        private const uint SHFS_SHOWSIPBUTTON = 0x0004;
        [DllImport("coredll.dll")]
        private extern static void SipShowIM(uint dwFlag);
    
        public static void ShowSIP(bool isShow, Control control)
        {
            SHFullScreen(control.Handle, isShow ? SHFS_SHOWSIPBUTTON : SHFS_HIDESIPBUTTON);
            SipShowIM(isShow ? SIPF_ON : SIPF_OFF);
        }
    
    }