🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.ms.programmer
Article #2083

Re: Temporarily adding scrollbars to window

#2083
From: Paul Bonneau
Date: Sun, 14 Apr 1991 17:52
24 lines
1365 bytes
In article <1991Apr12.044108.4007@mnemosyne.cs.du.edu> ebergman@isis.cs.du.edu (Eric Bergman-Terrell) writes:
>
>Folks:
>
>I'm trying to temporarily add horizontal and vertical scroll bars to a 
>window.
>
>Will SetWindowLong() do this?
>
>If so, how must it be used?  I'm trying sumething like the following:
>
>SetWindowLong(hwnd, GWL_STYLE, WS_OVERLAPPEDWINDOW | WS_VSCROLL | WS_HSCROLL);
>
The problem is that non-client area scrollbars are actually
child windows that are automatically created when the parent
window is created.  So they will not exist when you change
the parent's window style, and there will be nothing to
display.  What you need to do is create the parent window
with the WS_VSCROLL style and then hide the scroll bar
with SetScrollRange(hwndParent, SB_VERT, 0, 0, TRUE);.  When
it is time to show the scrollbar, give it a non-null scroll
range and it will appear.

cheers - Paul Bonneau.
Technical Details
Message-ID: <1991Apr14.175209.25965@hyper.hyper.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watserv1!watmath!hyper.hyper.com!bonneau
References: <1991Apr12.044108.4007@mnemosyne.cs.du.edu>

Show Full Headers
Complete Article Headers
Newsgroups: comp.windows.ms.programmer
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watserv1!watmath!hyper.hyper.com!bonneau
From: bonneau@hyper.hyper.com (Paul Bonneau)
Subject: Re: Temporarily adding scrollbars to window
Message-ID: <1991Apr14.175209.25965@hyper.hyper.com>
Reply-To: bonneau@hyper.UUCP (Paul Bonneau,,)
Organization: HyperCube Inc.
References: <1991Apr12.044108.4007@mnemosyne.cs.du.edu>
Date: Sun, 14 Apr 1991 17:52:09 GMT