Sporadic EVC code

Source: Internet
Author: User

//---------------------------------------------------------------------------
// 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 ();
}
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.