Jump to content
  • Advertisement
Sign in to follow this  
Adams555

Resize window.. But while keeping the same ratio.

This topic is 5063 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

Hello. Simple question. Can you do something so that a win32 window will maintain it's proportions when you try to resize it, and if so, how? I wish I could elaborate more, but that's pretty much all I need to know. Thanks, ~Adams555~ (I have a 1024x768 window, and I need it to stay at that ratio. (the ratio is 1 : 1+1/3)

Share this post


Link to post
Share on other sites
Advertisement
case WM_SIZING:
{
RECT* rect = (RECT*)lparam;
int width = rect->right-rect->left;
int height = rect->bottom-rect->top;
if(width != height*3/4)
{
height = width - width/4;
rect->bottom = rect->top + height;
}
}
break;

Share this post


Link to post
Share on other sites
no

edit:
"The WM_SIZE message is sent to a window after its size has changed."

"The WM_SIZING message is sent to a window that the user is resizing. By processing this message, an application can monitor the size and position of the drag rectangle and, if needed, change its size or position."

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!