Jump to content
  • Advertisement
Sign in to follow this  
luasitdown

How to let scroll control drag realtime?

This topic is 4693 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

Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!