In the pop-up mode dialog box, if there is an edit box, you need to automatically display the soft keyboard for input, and automatically adjust the soft keyboard position. If not an edit box, you should turn off the soft keyboard and set to the original location.
Inherited the CEDIT class, handle the message to get focus and loss of focus:
ON_CONTROL_REFLECT (En_setfocus, OnsetFocus)
ON_CONTROL_REFLECT (En_killfocus, ONKILLFOCUS)
Void CMyEdit :: Onsetfocus ()
{
RECT;
GetRect (& Re);
Clienttoscreen (& Re);
Sipinfo Si;
Si.dwimDataSize = 0;
Si.cbsize = sizeof (si);
Bool BSIP = SipGetInfo (& Si);
IF (Rect.top> = 150)
{
Si.rcsipRect.top = 0;
}
Else
{
Si.rcsipRect.top = 195; // Half of the screen
}
SipsetInfo (& Si);
SIPSHOWIM (SIPF_ON);
}
Void cmyedit :: ONKILLFOCUS ()
{
SIPSHOWIM (SIPF_OFF);
Sipinfo Si;
Si.dwimDataSize = 0;
Si.cbsize = sizeof (si);
Bool BSIP = SipGetInfo (& Si);
Si.rcsipRect.top = 195;
SipsetInfo (& Si);
}