-
Odd Sizing Issues
I have two questions to ask here.
First, I have custom maximize / restore handlers. Maximizing by clicking the button or right clicking the caption bar and selecting maximize works normally, by double clicking the caption bar itself doesn't show the right results. Turns out it's not sending SC_MAXIMIZE when I double click the caption bar, although it does just fine when I click the maximize button or right click caption bar->maximize. What message is sent when you double click the caption bar?
Secondly, I have scrolling code that works correctly on transition to full screen. If the X screen is larger than my client area bitmap, the scroll range is shrunk appropriately to not include the hroizontal scroll bar. Though, upon transition back to 'restore state', it brings up the scroll bars again because the X size of the bitmap window is less than it's maximum width. This means I can't get to the bottom strip of the bitmap; the size of a horizontal scroll bar. The code is made to handle this on WM_SIZE messages, and it does to an extent. You see, when I restore the window, it doesn't modify the scroll bars range when it clearly should. The twist is that when I manually resize it by any amount the scroll bar gains its correct proportions and I am able to scroll all the way. I tried slapping on stuff like doubling up on WM_SIZEs in parts but that did it no good...Any tips?
-
For your first issue, try catching SC_DEFAULT. It'll come in the form of a WM_SYSCOMMAND message.
http://msdn2.microsoft.com/en-us/library/ms646360.aspx
-
Depending on the reason you are using custom handlers it may be preferable to use WM_GETMINMAXINFO instead.
For the second problem, it sounds like WM_SIZE is not being sent. If you are overriding the default handler, it is probably your responsibility to send the WM_SIZE message.
-
Here's how I have it.
Parent window resized -> parent handler adjusts status bar and adjusts size to fit client area (and child window) into the new size. A MoveWindow is what gives the child window it's new size, no other sizing for the child is possible the way I have it layed out. It fits the client area but the scroll is totally wierd..
-
I'm at a loss...I can't come to grips with the fact that the only way to get the window to fix it's scroll bars after coming back from full screen is to resize it manually. That is just ridiciulous, but I think it's the only way I'll be able to do it. Is there a message I can use to fake this in program? It's going to be sloppy and hackish but I just don't know what else to do...