views:

3368

answers:

4

Hi,

I have the following problem:

I open the dialog, open the SIP keyboard to fill the form and then minimize the SIP. Then when I close the current dialog and return to the main dialog the SIP keyboard appears again. Does anyone know how could I show/hide SIP keyboard programatically or better what could be done to solve the described problem. Once the user minimizes the keyboard it should not appear on the screen on dialog switching.

Thanks!

A: 

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.

kgiannakakis
I'm writing the application in C++
niko
+1  A: 

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

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

MusiGenesis
+1  A: 

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.

Shane Powell
I've never heard of SHSipPreference. :) Based on the version support, it looks extremely old. I don't go anywhere near MFC dialogs, but I've never had any problems with SipShowIM in C#/.NET CF.
MusiGenesis
SHSipPreference is Windows CE 3.0 and later, SIPShowIM is Windows CE OS 2.10 and later, see http://msdn.microsoft.com/en-us/library/ms941818.aspxMine looks like the better API to use and newer :) SIPShowIM sets the state no matter what window, SHSipPreference is window specific and sticky.
Shane Powell
SipShowIM: "An application MUST call this function to display the input panel." Case closed. :)
MusiGenesis
This might be the most professionally obscure debate I've ever been involved in. :)
MusiGenesis
Each to there own... Niko and others can now choose whatever API they wish to use based on an informed choice, SHSipPreference naturally :)
Shane Powell
Yes, Niko is now free to use SHSipPreference and be cast into the fires of Hell for all eternity, or to use SipShowIM and corner the lucrative WinCE 2.10 applications market. :)
MusiGenesis
A: 

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.

Malx