|
-
December 16th, 2007, 01:08 AM
#3
Re: Scrollable window
All your doing right now is telling the window to create the scroll bar(s) but the window doesn't know what to do so you'll need to handle the WM_VSCROLL message to suite your needs.
To keep the scrollbar from moving back to 0,
Code:
case WM_VSCROLL:
{
static int scrollPos = HIWORD(wParam);
if (LOWORD(wParam) == SB_THUMBPOSITION)
{
scrollPos = HIWORD(wParam);
}
SetScrollPos(hWnd, SB_VERT, scrollPos, TRUE);
return 0;
}break;
You just need to handle some sub messages within WM_VSCROLL, SB_THUMBPOSITION simply saves the new position in the hi order word of the wParam, after the user finishes dragging.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|