This function scrolls a rectangle of bits horizontally and vertically.
At a Glance
Header file: | Winuser.h |
Windows CE versions: | 1.0 and later |
Syntax
BOOL ScrollDC(HDC hDC, int dx, int dy, const RECT *lprcScroll,
const RECT *lprcClip, HRGN hrgnUpdate, LPRECT lprcUpdate);
Parameters
hDC
[in] Handle to the device context that contains the bits to be scrolled.
dx
[in] Specifies the amount, in device units, of horizontal scrolling. This parameter must be a negative value to scroll to the left. Only one of the dx and dy parameters can be nonzero.
dy
[in] Specifies the amount, in device units, of vertical scrolling. This parameter must be a negative value to scroll up. Only one of the dx and dy parameters can be nonzero.
lprcScroll
[in] Long pointer to the RECT structure containing the coordinates of the scrolling rectangle.
lprcClip
[in] Long pointer to the RECT structure containing the coordinates of the clipping rectangle. Only device bits within the clipping rectangle are affected. Bits scrolled from the outside of the rectangle to the inside are painted; bits scrolled from the inside of the rectangle to the outside are not painted.
hrgnUpdate
[in] Handle to the region uncovered by the scrolling process. ScrollDC defines this region; it is not necessarily a rectangle.
lprcUpdate
[out] Long pointer to the RECT structure that receives the coordinates of the rectangle bounding the scrolling update region. This is the largest rectangular area that requires repainting. When the function returns, the values in the structure are in client coordinates, regardless of the mapping mode for the specified device context.
Return Values
Nonzero indicates success. Zero indicates failure. To get extended error information, call GetLastError.
Remarks
If the lprcUpdate parameter is NULL, the system does not compute the update rectangle. If both the hrgnUpdate and lprcUpdate parameters are NULL, the system does not compute the update region. If hrgnUpdate is not NULL, the system proceeds as though it contains a valid handle to the region uncovered by the scrolling process (defined by ScrollDC).
When you must scroll the entire client area of a window, use the ScrollWindowEx function.
See Also