index: WM_VSCROLL The WM_VSCROLL message is sent to a window when a scroll event occurs in the window's standard vertical scroll bar. This message is also sent to the owner of a vertical scroll bar control when a scroll event occurs in the control.
CWnd::ScrollWindow void ScrollWindow( int xAmount, int yAmount, LPCRECT lpRect = NULL, LPCRECT lpClipRect = NULL );ParametersxAmountSpecifies the amount, in device units, of horizontal scrolling. This parameter must be a negative value to scroll to the left.yAmountSpecifies the amount, in device units, of vertical scrolling. This parameter must be a negative value to scroll up.lpRectPoints to a CRect object or RECT structure that specifies the portion of the client area to be scrolled. If lpRect is NULL, the entire client area is scrolled. The caret is repositioned if the cursor rectangle intersects the scroll rectangle.lpClipRectPoints to a CRect object or RECT structure that specifies the clipping rectangle to scroll. Only bits inside this rectangle are scrolled. Bits outside this rectangle are not affected even if they are in the lpRect rectangle. If lpClipRect is NULL, no clipping is performed on the scroll rectangle.ResScrolls the contents of the client area of the current CWnd object.
SendMessage(WM_VSCROLL,SB_BOTTOM);SendMessage(WM_VSCROLL,SB_LINEDOWN);//向下一行
SendMessage(WM_VSCROLL,SB_LINEUP);SendMessage(WM_VSCROLL,SB_PAGEDOWN);//向下一页
SendMessage(WM_VSCROLL,SB_PAGEUP);
The WM_VSCROLL message is sent to a window when a scroll event occurs in the window's standard vertical scroll bar. This message is also sent to the owner of a vertical scroll bar control when a scroll event occurs in the control.
在MSDN里有很详细的帮助
SendMessage(WM_VSCROLL,SB_BOTTOM);SendMessage(WM_VSCROLL,SB_LINEDOWN);//向下一行
SendMessage(WM_VSCROLL,SB_LINEUP);SendMessage(WM_VSCROLL,SB_PAGEDOWN);//向下一页
SendMessage(WM_VSCROLL,SB_PAGEUP);////////////////////////////////////////////
参见:《windows程序设计》第5版
本人书读得少,不知《windows程序设计》第5版中是否真的有与我上面写的一样的一段话?
int xAmount,
int yAmount,
LPCRECT lpRect = NULL,
LPCRECT lpClipRect = NULL );
validateRect(CRect);
MFC windows 程序设计 P146有详细讲解
InvalidateRect(hWnd, &rect, TRUE);
UpdateWindow(hWnd);
void ScrollWindow( int xAmount, int yAmount, LPCRECT lpRect = NULL, LPCRECT lpClipRect = NULL );ParametersxAmountSpecifies the amount, in device units, of horizontal scrolling. This parameter must be a negative value to scroll to the left.yAmountSpecifies the amount, in device units, of vertical scrolling. This parameter must be a negative value to scroll up.lpRectPoints to a CRect object or RECT structure that specifies the portion of the client area to be scrolled. If lpRect is NULL, the entire client area is scrolled. The caret is repositioned if the cursor rectangle intersects the scroll rectangle.lpClipRectPoints to a CRect object or RECT structure that specifies the clipping rectangle to scroll. Only bits inside this rectangle are scrolled. Bits outside this rectangle are not affected even if they are in the lpRect rectangle. If lpClipRect is NULL, no clipping is performed on the scroll rectangle.ResScrolls the contents of the client area of the current CWnd object.