ShowSIP


Description:
This functions encapsulates the necessary code to show or hide the input panel on the palm-sized PC's (formerly known as the SIP). It returns the previous SIP status. To use it, you need to include aygshell.h, and link with aygshell.lib.
 
Code:
bool ShowSIP(bool bShow) {
    SIPINFO si;
    bool bRet;

    memset( &si, 0, sizeof( si ) );
    si.cbSize = sizeof( si );

    if( SHSipInfo( SPI_GETSIPINFO, 0, &si, 0 ) ) {
        bRet = (si.fdwFlags & SIPF_ON);
        if (bShow) {
            si.fdwFlags |= SIPF_ON;
        } else {
            si.fdwFlags &= ~SIPF_ON;
        }

        SHSipInfo( SPI_SETSIPINFO, 0, &si, 0 );
    }
    return bRet;
}
 
Sample Usage:
 
ShowSIP(false);