//---------------------------------------------------------------------------
// Shield the CE system desktop. Each form is called during initialization.
// EnableDesktop (FALSE );
// EnableDesktop (TRUE) is restored when only one main form exits );
// Note: other auxiliary forms cannot be blocked !! Restore the master form only once.
Void EnableDesktop (BOOL bEnable)
{
HWND hTaskBarWnd = NULL, hMenuBarWnd = NULL, hSipBtnWnd = NULL;
HTaskBarWnd =: FindWindow (_ T ("HHTaskBar"), NULL );
HMenuBarWnd =: FindWindow (_ T ("menu_worker"), NULL );
HSipBtnWnd =: FindWindow (_ T ("MS_SIPBUTTON"), NULL );
If (NULL = hTaskBarWnd | NULL = hMenuBarWnd) return;
If (TRUE = bEnable)
{
: EnableWindow (hTaskBarWnd, TRUE );
: ShowWindow (hTaskBarWnd, SW_SHOW );
: EnableWindow (hMenuBarWnd, TRUE );
: ShowWindow (hMenuBarWnd, SW_SHOW );
: EnableWindow (hSipBtnWnd, TRUE );
: ShowWindow (hSipBtnWnd, SW_SHOW );
}
Else
{
: EnableWindow (hTaskBarWnd, FALSE );
: ShowWindow (hTaskBarWnd, SW_HIDE );
: EnableWindow (hMenuBarWnd, FALSE );
: ShowWindow (hMenuBarWnd, SW_HIDE );
: EnableWindow (hSipBtnWnd, FALSE );
: ShowWindow (hSipBtnWnd, SW_HIDE );
}
}
//---------------------------------------------------------------------------
// Set the system keyboard CAPSLOCK to press and restore
// BState = TRUE: analog Press (uppercase)
// BState = FALSE: analog recovery (lower case)
Void setcapslock (bool bstate)
{
Enabledesktop (false );
Short B;
B = getkeystate (vk_capital );
/*
If (true = bstate & (loword (B) = 1) |
(False = bstate & (loword (B) = 0 )))
{
* /// Afxmessagebox (text ("down "));
Keybd_event (vk_capital,
0x45,
Keyeventf_extendedkey | 0,
0 );
Keybd_event (vk_capital,
0x45,
Keyeventf_extendedkey | keyeventf_keyup,
0 );
//}
}
//---------------------------------------------------------------------------
// No matter the size of the dialog box during design, the default dialog box when the PDA is running is full screen.
// Create a non-full screen dialog box:
// Create a CNonFSDialog and capture the m_bFullScreen
// All non-full-screen dialogs can be inherited from it.
Void CNonFSDialog: init ()
{
M_bFullScreen = FALSE; // not mentioned in the document
}
CNonFSDialog: CNonFSDialog ()
{
Init ();
}
CNonFSDialog: CNonFSDialog (UINT nIDTemplate, CWnd * pParent)
: CDialog (nIDTemplate, pParent)
{
Init ();
}
CNonFSDialog: CNonFSDialog (LPCTSTR lpszTemplateName, CWnd * pParent)
: CDialog (lpszTemplateName, pParent)
{
Init ();
}