In the Properties dialog box, how does one add icons and minimize buttons in the title bar?
Source: Internet
Author: User
In the Properties dialog box, how does one add icons and minimize buttons in the title bar?
2007-11-20 22:45:26
LargeMediumSmallTags:
It/TechnologyMFCCpropsheet1. Add the following code cpropsheet: oninitdialog () to oninitdialg ()
{
...... // Click the Minimize button.
Modifystyle (0, ws_minimizebox |
Ws_maximizebox); // Add an icon to the title bar
M_hicon = afxgetapp ()-> loadicon (idr_mainframe );
Seticon (m_hicon, true); // set big icon
Seticon (m_hicon, false); // set small icon // although the style can be added but cannot respond, you need to add a button on sysmenu.
Cmenu * psysmenu = getsystemmenu (false );
If (psysmenu! = NULL ){
Psysmenu-> insertmenu (0, mf_byposition | mf_string, SC _minimize, _ T ("minimal (& n )"));
Psysmenu-> insertmenu (0, mf_byposition | mf_string, SC _
Restore, _ T ("Restore (& R )"));
}
..........
} 2. Therefore, the following onsyscommand message must be reloaded;
Void cpropsheet: onsyscommand (uint NID, lparam)
{
Switch (NID)
{
Case SC _minimize:
Showwindow (sw_showminimized );
Return;
}
Cpropertysheet: onsyscommand (NID, lparam );
}
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.