PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: Wilko Verweij on December 23, 2014, 05:39:48 PM

Title: standard scroll bar and scroll bar control: how to distinguish
Post by: Wilko Verweij on December 23, 2014, 05:39:48 PM
Hi all,
I am aware of the difference between a "standard scroll bar" and a "scroll bar control" (see e.g. http://msdn.microsoft.com/en-us/library/windows/desktop/bb787527%28v=vs.85%29.aspx (http://msdn.microsoft.com/en-us/library/windows/desktop/bb787527%28v=vs.85%29.aspx)) and I can handle both of them, separately. But now I have a form where I have both a vertical standard scroll bar and a vertical scroll bar control.
Now if I click in the standard scroll bar, everything works as expected. However, if I click the scroll bar control, first the scroll bar control event is fired (that works as it should) but then, in addition, the event of the standard scroll bar is also fired! I've created a work-around, but I think there must be a way to avoid this. Does anyone know how to do that? As said, I've found a work-around so it's not urgent at all (don't let it spoil your Christmas ;)), but I just can't accept my clumsy work-around is the only way to do this.
Any suggestions?
Wilko
Title: Re: standard scroll bar and scroll bar control: how to distinguish
Post by: Wilko Verweij on December 23, 2014, 05:44:22 PM
I now see that if you test for the WM_SCROLL message, you should be able to distinguish using the lParam value.
http://msdn.microsoft.com/en-us/library/windows/desktop/bb787577%28v=vs.85%29.aspx (http://msdn.microsoft.com/en-us/library/windows/desktop/bb787577%28v=vs.85%29.aspx)
But the WM_VSCROLL message in FireFly does not give access to lParam. Should I intercept this message as a custom message....?
:-\
Confused...
Title: Re: standard scroll bar and scroll bar control: how to distinguish
Post by: Paul Squires on December 23, 2014, 11:56:47 PM
Hi Wilko, in the Christmas rush so haven't tested your problem but you're right - use CUSTOM would be the easiest solution.
:)
Title: Re: standard scroll bar and scroll bar control: how to distinguish
Post by: Wilko Verweij on December 25, 2014, 12:51:48 PM
Yes, that did it :)