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



The information in this article applies to:

  • Microsoft Windows CE Operating System, Versions 2.12
  • 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.

#include "stdafx.h"
#include "sipapi.h"

BOOL ToggleSIP();


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

    DEBUGMSG(1, (L"Starting SIP application"));
    RETAILMSG(1, (L"Starting SIP application"));
    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"SIPTest: no SIP available!!\r\n"));
		return FALSE;
	}
	
	si.fdwFlags ^= SIPF_ON;
	DEBUGMSG(1, (L"SIPTest: Bringing SIP %s\r\n", (si.fdwFlags&SIPF_ON) ? L"UP":L"DOWN"));
	return SipSetInfo(&si);
}

				

REFERENCES

Platform Builder 2.12 BooksOnLine, MSDN January 2000

Modification Type:MinorLast Reviewed:7/1/2004
Keywords:kbhowto KB264034