VScrollBar in a CListCtrl

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.

yoavoAsked:
Who is Participating?
 
migelConnect With a Mentor Commented:
Hi!
this method alvays returns NULL for windows that implements scrollbar via  windows styles.
Try use GetSrcollInfo to determine is scrollbar visible
0
 
yoavoAuthor Commented:
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
 
migelCommented:
Hi!
did you include mask SIF_RANGE?
does nMin == nMax??
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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.

 
yoavoAuthor Commented:
I included SIF_ALL (which is the default):
BOOL GetScrollInfo( int nBar, LPSCROLLINFO lpScrollInfo, UINT nMask = SIF_ALL );

mMin is always 0...
0
 
migelCommented:
nMax ?
0
 
yoavoAuthor Commented:
nMax depands on the height of the control.
I think if (nPage <= nMax) then the scroll appears...
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.