Odd Sizing Issues

This is a discussion on Odd Sizing Issues within the Windows Programming forums, part of the Platform Specific Boards category; I have two questions to ask here. First, I have custom maximize / restore handlers. Maximizing by clicking the button ...

  1. #1
    Registered User
    Join Date
    Jun 2006
    Posts
    36

    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?

  2. #2
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,211
    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

  3. #3
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544
    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.

  4. #4
    Registered User
    Join Date
    Jun 2006
    Posts
    36
    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..

  5. #5
    Registered User
    Join Date
    Jun 2006
    Posts
    36
    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...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help C program that reads Odd numbers and evens
    By Cyberman86 in forum C Programming
    Replies: 4
    Last Post: 02-27-2009, 10:59 AM
  2. Odd and even
    By swgh in forum C++ Programming
    Replies: 12
    Last Post: 09-18-2006, 05:56 PM
  3. adding odd numbers only
    By CheyenneWay in forum C++ Programming
    Replies: 12
    Last Post: 05-06-2004, 12:22 AM
  4. new type: even or odd
    By nbo10 in forum C++ Programming
    Replies: 7
    Last Post: 09-05-2003, 11:17 AM
  5. Homework help
    By Jigsaw in forum C++ Programming
    Replies: 2
    Last Post: 03-06-2002, 04:56 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21