Advertisement Jump to content


This topic is now archived and is closed to further replies.


changing the client window size

This topic is 6858 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Is there a function I can call to change the size of the client window? I don''t want to be stuck with the choices I made in CreateWindow (). I also have a question about CreateWindow (). Are the width and height specified the size the window will be, or the client window?

Share this post

Link to post
Share on other sites
you can use SetWindowPos() i think. look it up in the msdn it''s something starting with SetWindow...

in CreateWindow you specify the total size of the window, so if you say it should be 200pixels wide and the user has a default window frame of 10 pixels each, you will end up with a client area of 180p

Share this post

Link to post
Share on other sites
Those dimensions specify the dimensions of the entire frame of the window. If you want to change the size of the client area, try something like this:

RECT rect;

rect.left = = 0;
rect.right = width; rect.bottom = height;

AdjustWindowRect(&rect, style, FALSE);
SetWindowPos(hWnd, HWND_TOP, rect.left,, rect.right - rect.left, rect.bottom -, SWP_NOMOVE);

style is the stuff you used for the style parameter in CreateWindow or CreateWindowEx, like, say, WS_OVERLAPPEDWINDOW.

Now, if you''re using MFC, I think there''s a method in''s about that...I think it''s called AdjustWindowRect or something like that. And it''ll set your client area to whatever size you tell it. I *think*.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!