Microsoft KB Archive/264034

= How To Make Soft Input Panel (SIP) Appear and Work in Windows CE 2.12 =

Article ID: 264034

Article Last Modified on 7/1/2004

-

APPLIES TO


 * Microsoft Windows CE 2.12 for the Handheld PC
 * Microsoft Windows CE Platform Builder 2.12

-



This article was previously published under Q264034



SUMMARY
In some platforms such as CEPC, by default the Soft Input Panel (SIP) is not visible or active. There is a procedure for making a SIP appear on any platform, and the procedure is described in this article.



MORE INFORMATION
You may want to have SIP available on a Windows CE device as an alternative to having a keyboard. The method described allows an application to activate SIP when the computer is started and have SIP available for input from a touch-screen or by using a pointing device such as a mouse. If a keyboard is present, you can use both the SIP and the keyboard interchangeably.

To activate the SIP, follow these steps:


 * 1) Set the environment variable TESTSIP in the Common.reg file.
 * 2) In your application create a control structure for SIP that you use to control the display of the SIP programmatically.
 * 3) In the control structure, you can set the appropriate bits by using the SipSetInfo function. Alternatively, you can use the SipShowIM function with the SIPF_ON and SIPF_OFF constants. This is normally done in your system shell (as in HPC), or wherever you like in an application, and it makes the SIP appear or disappear.

The following code segment shows how to do this:

// Application to demonstrate use of SIP functions.


 * 1) include &quot;stdafx.h&quot;
 * 2) include &quot;sipapi.h&quot;

BOOL ToggleSIP;

int WINAPI WinMain(HINSTANCE hInstance,                    HINSTANCE hPrevInstance,                     LPTSTR     lpCmdLine,                     int       nCmdShow) {

DEBUGMSG(1, (L&quot;Starting SIP application&quot;)); RETAILMSG(1, (L&quot;Starting SIP application&quot;)); SipShowIM(SIPF_OFF);  // hide SIP Sleep(1000); SipShowIM(SIPF_ON);   // show SIP ToggleSIP; // toggle SIP display to turn OFF ToggleSIP; // toggle SIP display again to turn ON

return 0; }

// Function for toggling state of SIP. BOOL ToggleSIP(void) {   SIPINFO si;

memset(&si, 0, sizeof(SIPINFO)); si.cbSize = sizeof(SIPINFO); if(!SipGetInfo(&si)) { DEBUGMSG(1, (L&quot;SIPTest: no SIP available!!\r\n&quot;)); return FALSE; }   si.fdwFlags ^= SIPF_ON; DEBUGMSG(1, (L&quot;SIPTest: Bringing SIP %s\r\n&quot;, (si.fdwFlags&SIPF_ON) ? L&quot;UP&quot;:L&quot;DOWN&quot;)); return SipSetInfo(&si); }

