当前位置: 代码迷 >> WinCE >> 开机密码时startui.cpp加了ipShowIM(SIPF_ON)软键盘为什么还不出来?解决方法
  详细解决方案

开机密码时startui.cpp加了ipShowIM(SIPF_ON)软键盘为什么还不出来?解决方法

热度:179   发布时间:2016-04-28 13:45:49.0
开机密码时startui.cpp加了ipShowIM(SIPF_ON)软键盘为什么还不出来?
Startup_DlgProc()
{

switch (message)
{
case WM_INITDIALOG:
// Load and display the background bitmap.
hbm = LoadBitmap(g_hinst, MAKEINTRESOURCE(IDB_WINDOWSCE));
SendMessage(
GetDlgItem(hDlg, IDC_STATIC_PICT),
STM_SETIMAGE,
(WPARAM)IMAGE_BITMAP,
(LPARAM) hbm);

// Misc other info for the dialog.
LoadGlobalStrings();
#ifndef USE_LASS_AUTH
hwndPass = GetDlgItem(hDlg, IDC_PASS);
#endif

// Set the font size of the various parts of the dialog.
memset(&lFont, 0, sizeof(LOGFONT));
hDlgFont = (HFONT)SendMessage(hDlg, WM_GETFONT, 0, 0L);
if ( !hDlgFont )
{
hDlgFont = (HFONT)GetStockObject(SYSTEM_FONT);
}
GetObject(hDlgFont, sizeof(LOGFONT), &lFont);

if (hDlgFont && lFont.lfHeight)
{
lFont.lfWeight = FW_BOLD;

lFont.lfHeight = 13;
hDlgFont = CreateFontIndirect(&lFont);
if ( hDlgFont )
{
SendMessage(GetDlgItem(hDlg, IDC_STATIC_PASS), WM_SETFONT, (WPARAM)hDlgFont, 0L);
SendMessage(GetDlgItem(hDlg, IDC_COMPANY), WM_SETFONT, (WPARAM)hDlgFont, 0L);
SendMessage(GetDlgItem(hDlg, IDC_ADDRESS), WM_SETFONT, (WPARAM)hDlgFont, 0L);
SendMessage(GetDlgItem(hDlg, IDC_WORK_PHONE), WM_SETFONT, (WPARAM)hDlgFont, 0L);
SendMessage(GetDlgItem(hDlg, IDC_HOME_PHONE), WM_SETFONT, (WPARAM)hDlgFont, 0L);  
}

lFont.lfHeight = -16;
hDlgFont1 = CreateFontIndirect(&lFont);
if ( hDlgFont1 )
{
SendMessage(GetDlgItem(hDlg, IDC_STATIC_DAY), WM_SETFONT, (WPARAM)hDlgFont1, 0L);
SendDlgItemMessage(hDlg, IDC_NAME , WM_SETFONT, (WPARAM)hDlgFont1, 0L);
}

_tcscpy(lFont.lfFaceName, g_szStartupTimeFontName);
lFont.lfHeight = -20;
hDlgFont2 = CreateFontIndirect(&lFont);
if ( hDlgFont2 )
{
SendMessage(GetDlgItem(hDlg, IDC_STATIC_TIME), WM_SETFONT, (WPARAM)hDlgFont2, 0L);
}
}



// Set focus to the dialog itself, so WM_CHAR's are received.
// If we're not using LASS and we requireAuth we'll switch the 
// focus to the password field.
  SetFocus(hDlg);
if( isAuthRequired() )
{
EnableMenuItem(GetSystemMenu(hDlg, FALSE), SC_CLOSE, MF_BYCOMMAND | MF_GRAYED); // disable close button
#ifndef USE_LASS_AUTH
ShowWindow(hwndPass, SW_SHOW);
ShowWindow(GetDlgItem(hDlg, IDC_STATIC_PASS), SW_SHOW);
SendMessage(hwndPass, EM_LIMITTEXT, PASSWORD_LENGTH, 0L);
SetFocus(hwndPass); 
//add soft keypad, begin<<
RECT rcDefault;
SystemParametersInfo(SPI_GETWORKAREA, 0, &rcDefault, FALSE);
rcDefault.left =
rcDefault.top =
rcDefault.top =
rcDefault.top = rcDefault.bottom - 80;
SipSetDefaultRect(&rcDefault);
ipShowIM(SIPF_ON);
//add soft keypad, end>>
#endif 
  }

i = 0;
if ( g_pOwnerNotes->NotesPowerUp )
{
i += SetAndShow(hDlg, IDC_NOTES, g_pOwnerNotes->Notes);
}

if ( !i)
{
ShowWindow(GetDlgItem(hDlg, IDC_NOTES),SW_HIDE);
}


i = 0;
if ( g_pOwnerProfile->IDPowerUp )
{
i += SetAndShow(hDlg, IDC_NAME, g_pOwnerProfile->szName);
i += SetAndShow(hDlg, IDC_COMPANY, g_pOwnerProfile->szCompany);
i += SetAndShow(hDlg, IDC_ADDRESS, g_pOwnerProfile->szAdd);

_tcscpy(szText, g_szStartupWork);
AddString(szText, g_pOwnerProfile->szWCC);
AddString(szText, g_pOwnerProfile->szWAC);
  相关解决方案