How does one retrieve a handle to a scrollbar child window created by passing WS_*SCROLL as an argument to createwindowex(...)?
Also, in the same vein, how does one go about disabling a similarly created scrollbar without hiding it?
How does one retrieve a handle to a scrollbar child window created by passing WS_*SCROLL as an argument to createwindowex(...)?
Also, in the same vein, how does one go about disabling a similarly created scrollbar without hiding it?
Last edited by rottinglich; 11-03-2004 at 04:27 AM. Reason: Additive
Not easily. If you don't want the default behaviour that comes with WS_HSCROLL/WS_VSCROLL embedded scrollbars then don't use those styles - use a distinct scrollbar control instead.
However, if you still want to investigate the possibility of getting the scrollbar handle etc. created as a child of another window with one of the WS_*SCROLL styles then you might want to try looking for the "scrollbar" window class name within a CBTProc hook procedure and subclassing the scrollbar(s) from there.
CProgramming FAQ
Caution: this person may be a carrier of the misinformation virus.
Ken's suggestion is close, but the class name is actually "ScrollBar".
Precisely what I needed, thank you both.
Now, about disabling thhe scroll bars...
Actually, there's no possibility of using the CBTProc hook as I have suggested might be possible earlier because the 'scrollbars' attached to a window with one of the WS_*SCROLL styles is actually a non-client 'decoration' and not a window in its own right. You can confirm this by either trying the CBTProc hook or, more quickly, by using something like spy++.
A fuller explanation including answers to the original question regarding disabling can be found here.
CProgramming FAQ
Caution: this person may be a carrier of the misinformation virus.
I used the Scroll Bar control you mentioned earlier and figuring out disabling was simple logic from there. Again, thank you.