MFC windows with title bar and windows with no title bar maximize

Source: Internet
Author: User

Original link: http://blog.csdn.net/smartgps2008/article/details/7741223

maximize the window without the title bar :

First case: Overriding the taskbar

ShowWindow (sw_showmaximized);

Second case: Don't overwrite the taskbar

int cx = GetSystemMetrics (sm_cxfullscreen);

int cy = GetSystemMetrics (Sm_cyfullscreen);

CRect RT;

SystemParametersInfo (spi_getworkarea,0,&rt,0);

cy = Rt.bottom;

MoveWindow (0, 0, CX, CY);

Maximize the window with the title bar:

First case: Overriding the taskbar

Inside OnSize (UINT nType, int cx, int cy)

if (NType = = size_maximized)

{

This must be GetSystemMetrics (Sm_cxscreen)-1 to show the full screen effect

SetWindowPos (&wndtopmost, 0, 0, GetSystemMetrics (sm_cxscreen)-1, GetSystemMetrics (Sm_cyscreen), 0);

}

Second case: Don't overwrite the taskbar

ShowWindow (sw_showmaximized);

MFC windows with title bar and windows with no title bar maximize

Related Article

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.