MFC modifies window untitled and header information, modifies the Execute file icon

Source: Internet
Author: User

I. After creating MFC, the window displays untitled-project name

Modify the method on the Internet to see a few, the following is a relatively simple:

1. Find this function in the mianframe.c file BOOL CMainFrame::P Recreatewindow (createstruct& CS)

2. Add such a sentence to the function to modify the title name

M_strtitle = "My title v1.0";

3. Add the following code to the function to remove the words without headings

Cs.style &= ~fws_addtotitle;//Prevent MFC from adding a document name on the window title bar

Return CFrameWnd::P Recreatewindow (CS);

Two. window display position and whether to maximize

1. This function is also found in the mianframe.c file BOOL CMainFrame::P Recreatewindow (createstruct& CS)

2. Add the following code to maximize the window display

cs.x=cs.y=0; In the upper-left corner of the screen
Cs.cx=getsystemmetrics (sm_cxmaximized); Maximize and display the status bar
Cs.cy=getsystemmetrics (sm_cymaximized);
Cs.style &= ~fws_addtotitle;//Prevent MFC from adding a document name on the window title bar

Return CFrameWnd::P Recreatewindow (CS);

two. Modify the Execute file icon

Locate the Res folder in the project file to change the icon of the original project filename to create a good one for you. But to convert to an ICO file.

MFC modifies window untitled and header information, modifies the Execute file icon

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.