ScrollDC

2.x

  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 FAR* lprcScroll; /* address of scrolling rectangle */
  const RECT FAR* lprcClip; /* address of clipping rectangle */
  HRGN hrgnUpdate; /* handle of scrolling region */
  RECT FAR* lprcUpdate; /* address of structure for update rect. */

The ScrollDC function scrolls a rectangle of bits horizontally and vertically.

Parameters

hdc

Identifies the device context that contains the bits to be scrolled.

dx

Specifies the number of horizontal scroll units.

dy

Specifies the number of vertical scroll units.

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 */
   int left;
   int top;
   int right;
   int bottom;
} RECT;

For a full description of this structure, see the Microsoft Windows Programmer's Reference, Volume 3.

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 the lprcScroll parameter, 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.

Return Value

The return value is nonzero if the function is successful. 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 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.

See Also

InvalidateRgn, ScrollWindow, ScrollWindowEx