3

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!

Niko Gamulin
  • 66,025
  • 95
  • 221
  • 286
  • I've found out what causes such behavior. 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... – Niko Gamulin Nov 27 '08 at 14:51
  • The line you removed didn't actually work, right (I mean it didn't pull up the keyboard in numeric mode, correct)? – MusiGenesis Nov 27 '08 at 15:25
  • @ Niko : Hey have you got ans for your question.. i am also need of it.. please let me know.. – Naruto Oct 01 '09 at 05:20

5 Answers5

2

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

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

MusiGenesis
  • 74,184
  • 40
  • 190
  • 334
1

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
  • 13,698
  • 2
  • 49
  • 61
  • 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 Nov 27 '08 at 23:41
  • 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.aspx Mine 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 Nov 28 '08 at 19:25
  • SipShowIM: "An application MUST call this function to display the input panel." Case closed. :) – MusiGenesis Nov 28 '08 at 20:34
  • This might be the most professionally obscure debate I've ever been involved in. :) – MusiGenesis Nov 28 '08 at 20:35
  • 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 Nov 30 '08 at 17:52
  • 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 Nov 30 '08 at 20:22
0

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
  • 103,016
  • 27
  • 158
  • 194
0

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
  • 990
  • 1
  • 9
  • 16
0

...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.

KatieK
  • 13,586
  • 17
  • 76
  • 90