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 Large Medium SmallTags: It/Technology MFC Cpropsheet1. 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 );
}

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.