Solved

VScrollBar in a CListCtrl

Posted on 2002-06-12
6
631 Views
Last Modified: 2013-11-20
Hi,
I need to know if a Vertical ScrollBar is shown in a CListCtrl. I tried to use:
CScrollBar* CWnd::GetScrollBarCtrl(int) const,
but it does not work (returns NULL, unless class derive from CView...).

thanks,
Yoav.

0
Comment
Question by:yoavo
[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
  • 3
  • 3
6 Comments
 
LVL 12

Accepted Solution

by:
migel earned 100 total points
ID: 7074816
Hi!
this method alvays returns NULL for windows that implements scrollbar via  windows styles.
Try use GetSrcollInfo to determine is scrollbar visible
0
 

Author Comment

by:yoavo
ID: 7074901
Hi migel,
I tried using GetScrollInfo, and I am not sure I can get from the SCROLLINFO structure if a scroll bar exist or not.
The only thing I found out is that when a scroll bar does not exist then then in the SCROLLINFO struct: nPage > nMax
can I trust this ???

Yoav.
0
 
LVL 12

Expert Comment

by:migel
ID: 7074944
Hi!
did you include mask SIF_RANGE?
does nMin == nMax??
0
Independent Software Vendors: 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!

 

Author Comment

by:yoavo
ID: 7074965
I included SIF_ALL (which is the default):
BOOL GetScrollInfo( int nBar, LPSCROLLINFO lpScrollInfo, UINT nMask = SIF_ALL );

mMin is always 0...
0
 
LVL 12

Expert Comment

by:migel
ID: 7074994
nMax ?
0
 

Author Comment

by:yoavo
ID: 7075023
nMax depands on the height of the control.
I think if (nPage <= nMax) then the scroll appears...
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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…
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.

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