Resize window.. But while keeping the same ratio.

Started by
4 comments, last by mike25025 19 years, 3 months ago
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)
Advertisement
x : x + x/3 ?
1 : 4/3

or

3 : 4
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;
wouldn't the correct case be WM_SIZE?
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."

This topic is closed to new replies.

Advertisement