I want my window to always maintain a certain ratio of let's say 1.33333333. So, if the window is width = 800, height = 600
and the user changes the width to 600, I want to change the height to 450 automatically.
I'm already intercepting WM_SIZE
but I don't know if it's enough; also I don't know how to change the width or height to maintain my ratio.
WM_SIZING is sent to the window while the user is resizing the window.
Rather handle WM_WINDOWPOSCHANGING - this is sent by the internal SetWindowPos function when code (or the user) changes the window size and will ensure that even tile & cascade operations obey your sizing policy.
See WM_SIZING
: http://msdn.microsoft.com/en-us/library/ms632647.aspx
Processing this message allows you to change resulting window size.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With