Tech Support > Microsoft Windows > Development Resources > Scrollbars shown wrong
Scrollbars shown wrong
Posted by Gerd on February 21st, 2007


Hello,

I have a problem with my window. I create a statusbar at the bottom
and then I call
ShowScrollBar (hwnd, SB_BOTH, FALSE). When I set the scroll info, the
scrollbars are shown, but - the horizontal is _below_ the statusbar
(instead above as I expected) and the vertical scrollbar overlaps the
statusbar (instead ending above).

What did I wrong? What have I to do to get the expected behaviour?

Thanks,
Gerd

Posted by Scott McPhillips [MVP] on February 21st, 2007


Gerd wrote:
Your window does not "know" about the status bar at the bottom and does
not automatically adjust for it. You have to do all that yourself. (Or
use MFC, which does it for you.)

Create a main window, for the titlebar, menu and frame. It should not
have scroll bars. Then create child windows inside the main window.
One child window is the status bar. Another child window will be the
drawing area, with the scroll bars. Resize and position the child
windows in main's WM_SIZE so they do not overlap each other.

--
Scott McPhillips [VC++ MVP]


Posted by Gerd on February 21st, 2007



Scott McPhillips [MVP] schrieb:

Thanks for your explaination.

Which window class would I have to use for this?


Posted by Scott McPhillips [MVP] on February 21st, 2007


Gerd wrote:
You make your own with RegisterClassEx(). System-defined class names
are only good for creating controls dynamically.

--
Scott McPhillips [VC++ MVP]


Posted by Gerd on February 22nd, 2007



Scott McPhillips [MVP] schrieb:

You mean, I do it the same way like I create my main- (desktop-)
window (but without title, sysmenu, border etc)? With it's own message
function? Do I need an extra message loop for it?



Similar Posts