Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Subclassing scrollbars in list and tree controls

Posted on 2002-05-09
1
Medium Priority
?
915 Views
Last Modified: 2013-11-20
How can I subclass the scrollbar inside a CListCtrl or a CTreeCtrl.  The method GetScrollBarCtrl returns NULL. My lists and tree are very nice but I'm stuck with ugly gray scrollbars. I only I could get a hold on it...
0
Comment
Question by:mahtieubrault
1 Comment
 
LVL 49

Accepted Solution

by:
DanRollins earned 600 total points
ID: 7000034
The so-called 'standard scrollbars' (the ones that appear when the WS_HSCROLL, WS_VSCROLL, or both styles are used when the windows is created) are not actual windows.  THey are elements of the non-client frame of the windows.  Thus, you can't get a handle to them and you can't do any sort of normal subclassing operation.  

The CWnd::GetScrollBarCtrl fn comes into play for CView-derived windows in which a separate CControlBar is created as a 'peer' to the windows that will be scrolled.
=-=-=--==-=-=-=-=-=-=-
Have you tried the InitializeFlatSB() and  FlatSB_SetScrollProp() APIs?  I have not, but it looks like a reasonable way to try out some cosmetic variations on std scrollbars.

-- Dan
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Ready to get certified? Check out some courses that help you prepare for third-party exams.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Suggested Courses

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question