Sign in to follow this  

How to let scroll control drag realtime?

This topic is 4379 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I assume you're using Win32 scrollbar, this link to MSDN may help:
Scroll Bars Overviews
Creating/processing a scrollbar in traditional Win32 apps requires quite a lot of code, however simple. In short, a message SB_THUMBTRACK will be sent each time user drags the scrollbar, then the program updates window content by passed WPARAM and LPARAM.
Sample code

Share this post


Link to post
Share on other sites
Quote:
Original post by Skeleton_V@T
I assume you're using Win32 scrollbar, this link to MSDN may help:
Scroll Bars Overviews
Creating/processing a scrollbar in traditional Win32 apps requires quite a lot of code, however simple. In short, a message SB_THUMBTRACK will be sent each time user drags the scrollbar, then the program updates window content by passed WPARAM and LPARAM.
Sample code


Yes I do win32 scrollbar I also use SB_THUMBTRACK,but If I drag thumb,the WM_VSCROLL message (SB_THUMBTRACK in it) is not sent till I release mouse .
I want to drag a thumb without release mouse the message is sent.

Share this post


Link to post
Share on other sites
You need to set the flag SIF_TRACKPOS in SCROLLINFO structure before handling scrollbar messages:

WindowProc (Blah blah...)
{
switch (Message)
{
case WM_VSCROLL:
SCROLLINFO si ;
si.cbSize = sizeof (SCROLLINFO) ;
si.fMask = SIF_ALL ; //Included SIF_TRACKPOS
GetScrollInfo (hWnd, SB_VERT, &si) ;

switch (LOWORD (wparam))
{
case SB_TOP:
//...
case SB_BOTTOM:
//...
case SB_THUMBTRACK:
si.nPos = si.nTrackPos ; //Set scrollbar position by the value just updated in nTrackPos
break ;
}
}

return DefWindowProc (...) ;
}

Share this post


Link to post
Share on other sites
Quote:
Original post by Skeleton_V@T
You need to set the flag SIF_TRACKPOS in SCROLLINFO structure before handling scrollbar messages:
*** Source Snippet Removed ***


To scroll control child window ,this still work?

SCROLLINFO seem to system scroll

Share this post


Link to post
Share on other sites

This topic is 4379 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this