Solved

Subclassing scrollbars in list and tree controls

Posted on 2002-05-09
1
876 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 49

Accepted Solution

by:
DanRollins earned 200 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

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: 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…
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.
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

734 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