Do anyone have any idea on optimized resizing rebar code? The rebar have CCS_NOPARENTALIGN and CCS_NORESIZE style. It seems that Winzip do not use MoveWindow to resize the rebar when parent window receive the WM_SIZE message, so how do it resize the rebar?
Posted on 2001-02-13 10:54:00 by Bingo
Optimizing? Nope, got no idea. Seems to me the rebar was designed with limited purpose, such as being the ONLY rebar on the window. I played with it for a few days with no luck. But what DOES work is manually moving it. I defined a proc ResizeMain that handles all the controls on my main app window.. quite a sizeable ammount too. 4 rebars, a status bar that might dissapear, and a MDI holder in the center. I keep em all nicely aligned no matter what's in the rebars like so: ResizeMain makes no assumptions about existing child sizes, goes and gets them all (GetChildRect). It also gets the main client area in case the window was resized. Then it computes how much room to allot each, and then calls MoveWindow to place them. Took me around 100 lines of commented code to get it done, and it works acceptably fast. I set the style as so:

REBAR_STYLE   EQU   WS_VISIBLE or WS_BORDER or WS_CHILD or \
                    CCS_NODIVIDER or CCS_NOPARENTALIGN or CCS_ADJUSTABLE  or  \
                    RBS_VARHEIGHT or RBS_AUTOSIZE or RBS_BANDBORDERS
That I or with C__LEFT, CSS_TOP, whatever for which side I want it one.
Posted on 2001-02-13 11:38:00 by Ernie