BOOL ScrollDC(hdc, dx, dy, lprcScroll, lprcClip, hrgnUpdate, lprcUpdate) | |||||
HDC hdc; | /* handle of device context | */ | |||
int dx; | /* horizontal scroll units | */ | |||
int dy; | /* vertical scroll units | */ | |||
CONST RECT *lprcScroll; | /* address of scrolling rectangle | */ | |||
CONST RECT *lprcClip; | /* address of clipping rectangle | */ | |||
HRGN hrgnUpdate; | /* handle of scrolling region | */ | |||
LPRECT lprcUpdate; | /* address of structure for update rect. | */ |
The ScrollDC function scrolls a rectangle of bits horizontally and vertically.
hdc
Identifies the device context that contains the bits to be scrolled.
dx
Specifies the amount, in device units, of horizontal scrolling. This parameter must be a negative value to scroll to the left.
dy
Specifies the amount, in device units, of vertical scrolling. This parameter must be a negative value to scroll up.
lprcScroll
Points to the RECT structure that contains the coordinates of the scrolling rectangle. The RECT structure has the following form:
typedef struct tagRECT { /* rc */
LONG left;
LONG top;
LONG right;
LONG bottom;
} RECT;
lprcClip
Points to the RECT structure that contains the coordinates of the clipping rectangle. When this rectangle is smaller than the original one pointed to by lprcScroll, scrolling occurs only in the smaller rectangle.
hrgnUpdate
Identifies the region uncovered by the scrolling process. The ScrollDC function defines this region; it is not necessarily a rectangle.
lprcUpdate
Points to the RECT structure that receives the coordinates of the rectangle that bounds the scrolling update region. This is the largest rectangular area that requires repainting. The values in the structure when the function returns are in client coordinates, regardless of the mapping mode for the given device context.
The return value is TRUE if the function was successful, or FALSE if an error occurred. To obtain extended error information, use the GetLastError function.
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 handle of the region uncovered by the scrolling process (defined by the ScrollDC function).
When the ScrollDC function returns, the values in the structure pointed to by the lprcUpdate parameter are in client coordinates. This allows applications to use the update region in a call to the InvalidateRgn function, if required.
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.
InvalidateRgn, ScrollWindow