Windows client Area window size settings

Source: Internet
Author: User

#define WINDOW_WIDTH 800

#define Window_height 600

Windows (non-client area) that are set up with a length of

So when we use the function GetClientRect (hwnd, &rect) to get the client area size rect.right for 782 rect.bottom for 555

So if you want to set up a client area of 600 x

RECT Rect1;
RECT Rect2;
GetWindowRect (hwnd, &RECT1); Four coordinates representing the upper-left and lower-right corners of the window rectangle in the x y-coordinate of the screen
GetClientRect (Main_window_handle, &rect2); Four coordinates represent the X y-coordinate of the upper-left and lower-right corners of the customer area, respectively

2*window_width-rect2.right equivalent to Window_width + (window_width–rect2.right)

Window_width–rect2.right Customer Area – 782

Expanding the window by 18 (800-782) pixels is also equivalent to expanding the client area by 18 pixels

MoveWindow (hwnd,

Rect1.left, Rect1.top,

2*window_width-rect2.right,

2*window_height-rect2.bottom,

true);

Windows client Area window size settings

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.