For those of you who may find yourself needing to program a Windows CE 3.0
/ PocketPC device, it can be very helpful to your users if you ALWAYS
ensure that the virtual keyboard is available before asking them for any
textual input.  Here is the code necessary for doing so:

#include <sip.h>
#include <aygshell.h>

void SomeFunction(long Argument)
{
        // Try to bring up input panel
        BOOL fRes = FALSE;
        SIPINFO si;
        memset(&si, 0, sizeof(si));
        si.cbSize = sizeof(si);
        if (SHSipInfo(SPI_GETSIPINFO, 0, &si, 0))
        {
                si.fdwFlags |= SIPF_ON;
                fRes = SHSipInfo(SPI_SETSIPINFO, 0, &si, 0);
        }

// ....
}

Note that you may wish to do similar code but mask out the SIPF_ON bit to
remove the input panel when finished...
                si.fdwFlags &= ~SIPF_ON;

As a concrete example, the authentication process under VNC viewer for CE
is extremely annoying, because "Today" (the scheduling app that is almost
always up) does not provide a way to bring up the keyboard.  So if you
forget to switch to something else, you have to jump through a lot of hoops
to get the keyboard up and focus back on the authentication dialog.  Here
is the top of AuthDialog.cpp, with my modifications inside the "#if
UNDER_CE" blocks.  This works quite nicely.  When the auth dialog closes,
the keyboard closes itself, so it is not necessary to mask out the SIPF_ON
flag.

Mac



// AuthDialog.cpp: implementation of the AuthDialog class.

#include
"stdhdrs.h"
#include "vncviewer.h"
#include "AuthDialog.h"
#include
"Exception.h"

#if UNDER_CE
#include <sip.h>
#include <aygshell.h>
#endif

////////////////////////////////////////////////////////////////////
//
//
Construction/Destruction
///////////////////////////////////////////////////
///////////////////

AuthDialog::AuthDialog()
{

m_passwd[0]=(TCHAR)'\0';//_TEXT('\0');
}

AuthDialog::~AuthDialog()
{
}

int
 AuthDialog::DoDialog()
{
#if UNDER_CE
        // Try to bring up input panel
        BOOL fRes = FALSE;
        SIPINFO si;
        memset(&si, 0, sizeof(si));
        si.cbSize = sizeof(si);
        if (SHSipInfo(SPI_GETSIPINFO, 0, &si, 0))
        {
                si.fdwFlags |= SIPF_ON;
                fRes = SHSipInfo(SPI_SETSIPINFO, 0, &si, 0);
        }
#endif



        return DialogBoxParam(pApp->m_instance,
DIALOG_MAKEINTRESOURCE(IDD_AUTH_DIALOG), 
                NULL, (DLGPROC) DlgProc, (LONG)
this);
}
---------------------------------------------------------------------
To unsubscribe, send a message with the line: unsubscribe vnc-list
to [EMAIL PROTECTED]
See also: http://www.uk.research.att.com/vnc/intouch.html
---------------------------------------------------------------------

Reply via email to