开机密码时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);
AddString(szText,g_pOwnerProfile->szWPhone);
if ( _tcscmp(szText, g_szStartupWork) )
{
i += SetAndShow(hDlg, IDC_WORK_PHONE,szText);
}
_tcscpy(szText, g_szStartupHome);
AddString(szText,g_pOwnerProfile->szHCC);
AddString(szText,g_pOwnerProfile->szHAC);
AddString(szText,g_pOwnerProfile->szHPhone);
if ( _tcscmp(szText, g_szStartupHome) )
{
i += SetAndShow(hDlg, IDC_HOME_PHONE, szText);
}
}
//Show picture if there is no user data.
if ( !i )
{
ShowWindow(GetDlgItem(hDlg, IDC_STATIC_PICT), SW_SHOW);
}
oldEditCtlProc = (WNDPROC) GetWindowLong(GetDlgItem(hDlg,IDC_NOTES), GWL_WNDPROC);
SetWindowLong(GetDlgItem(hDlg,IDC_NOTES),GWL_WNDPROC,(LONG)EditCtlProc);
SetWindowLong(GetDlgItem(hDlg,IDC_ADDRESS),GWL_WNDPROC,(LONG)EditCtlProc);
HideCaret(GetDlgItem(hDlg,IDC_NOTES));
idTimer = SetTimer(hDlg, 1, 1000, NULL);
return FALSE;
........
[解决办法]
还要在case WM_CLOSE:中
添加:SipShowIM(SIPF_OFF);
[解决办法]
到这里看看,应该可以。
http://www.cnblogs.com/we-hjb/archive/2009/02/16/1391984.html