ScrollDC

Syntax

BOOL ScrollDC(hDC,dx,dy,lprcScroll,lprcClip,hrgnUpdate,lprcUpdate)

This function scrolls a rectangle of bits horizontally and vertically. The lprcScroll parameter points to the rectangle to be scrolled, the dx parameter specifies the number of units to be scrolled horizontally, and the dy parameter specifies the number of units to be scrolled vertically.

Parameter Type/Description  

hDC HDC Identifies the device context that contains the bits to be scrolled.  
dx int Specifies the number of horizontal scroll units.  
dy int Specifies the number of vertical scroll units.  
lprcScroll LPRECT Points to the RECT data structure that contains the coordinates of the scrolling rectangle.  
lprcClip LPRECT Points to the RECT data structure that contains the coordinates of the clipping rectangle. When this rectangle is smaller than the original pointed to by lprcScroll, scrolling occurs only in the smaller rectangle.  
hrgnUpdate HRGN Identifies the region uncovered by the scrolling process. The ScrollDC function defines this region; it is not necessarily a rectangle.  
lprcUpdate LPRECT Points to the RECT data structure that, upon return, contains the coordinates of the rectangle that bounds the scrolling update region. This is the largest rectangular area that requires repainting.  

Return Value

This value specifies the outcome of the function. It is nonzero if scrolling is executed. Otherwise, it is zero.

Comments

If the lprcUpdate parameter is NULL, Windows does not compute the update rectangle. If both the hrgnUpdate and lprcUpdate parameters are NULL, Windows does not compute the update region. If hrgnUpdate is not NULL, Windows assumes that it contains a valid region handle to the region uncovered by the scrolling process (defined by the ScrollDC function).

An application should use the ScrollWindow function when it is necessary to scroll the entire client area of a window. Otherwise, it should use ScrollDC.