Jump to content
  • Advertisement

Archived

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

Densun

changing the client window size

This topic is 6764 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
Advertisement
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 = rect.top = 0;
rect.right = width; rect.bottom = height;

AdjustWindowRect(&rect, style, FALSE);
SetWindowPos(hWnd, HWND_TOP, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, 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 CWnd...how''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 GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!