Solved

Subclassing scrollbars in list and tree controls

Posted on 2002-05-09
1
857 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 200 total points
Comment Utility
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
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.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

728 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now