how to show/hide SIP on Pocket PC

与世无争的帅哥 提交于 2019-12-06 01:07:42

We use SHSipPreference to control the display of the SIP in our applications. I know it works with MFC and it sets the state of the SIP for the window so you can set it once and you know the SIP state will be restored to your set state every time the window is shown.

I've never heard of SipShowIM but I did see on the MSDN page linked:

The standard method of showing and hiding the SIP (SIPShowIM) exhibits some problems in MFC dialogs.

You'll want to call SipShowIM() in coredll. See this MSDN article:

http://msdn.microsoft.com/en-us/library/ms838341.aspx

You can use the Microsoft.WindowsCE.Forms.InputPanel component. You can show/hide the SIP programmatically using the Enabled property. There is an InputPanel component at the toolbox.

There is also an EnabledChanged event for the InputPanel that you can handle. You usually want to show the SIP at a GetFocus event of a textbox.

Are you using MFC?

The problem is SIP state is per dialog, not per application. So you need to show/hide it inside every dialog independently.

void CAaa::OnActivate( UINT nState, CWnd* pWndOther, BOOL bMinimized )
{
if(nState == WA_ACTIVE || nState == WA_CLICKACTIVE)
{
        SHINITDLGINFO shidi;
            shidi.dwMask = SHIDIM_FLAGS;
            shidi.dwFlags = SHIDIF_FULLSCREENNOMENUBAR|SHIDIF_SIPDOWN | SHFS_HIDETASKBAR;
            shidi.hDlg = m_hWnd;
            SHInitDialog(&shidi);

        SHFullScreen(m_hWnd, SHFS_HIDETASKBAR | SHFS_HIDESIPBUTTON |SHFS_HIDESTARTICON);
}
}

And you should remove any Fullscreen or taskbar keys if not needed :)

And the other thing to use:

 SHSipPreference(m_hWnd,SIP_UP); // SIP_DOWN

Or even:

 HWND hwndCB = ::FindWindow(_T("SipWndClass"),_T(""));
      ::ShowWindow( hwndCB, SW_SHOW);
      hwndCB = ::FindWindow(_T("MS_SIPBUTTON"),NULL);
      ::ShowWindow( hwndCB, SW_SHOW);

But the latter could be not so standard :) Still it works. Try them.

Jeffrey Walton

...In some other dialog I want to set the keyboard layout to numeric, so I added the following line in the constructor: SendMessage(EM_SETINPUTMODE, 0, EIM_NUMBERS); However if I remove this line I solve one issue and create another one

GetLastError() is either 6 (invalid handle) or 120 (not supported). EM_SETINPUTMODE is only supported on SmartPhones, and SmartPhones don't have SIPs. See http://msdn.microsoft.com/en-us/library/bb416452.aspx.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!