Solved

Subclassing scrollbars in list and tree controls

Posted on 2002-05-09
1
873 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

726 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