Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
WinScrollWindow (1.2)
◄Function Group► ◄Overview► ◄Up► ◄Next► ◄Previous►
────────────────────────────────────────────────────────────────────────────
#define INCL_WINWINDOWMGR
SHORT WinScrollWindow(hwnd, dx, dy, prclScroll, prclClip, hrgnUpdate,
prclUpdate, fs)
HWND hwnd; /* handle of the window to scroll */
SHORT dx; /* amount of horizontal scrolling */
SHORT dy; /* amount of vertical scrolling */
PRECTL prclScroll; /* address of structure with scroll rectangle */
PRECTL prclClip; /* address of structure with clip rectangle */
HRGN hrgnUpdate; /* handle of the update region */
PRECTL prclUpdate; /* address of the structure for the update rectangle */
USHORT fs; /* scrolling flags */
The WinScrollWindow function scrolls the contents of a window rectangle.
No application should move bits in its own window by any other method than
by using WinScrollWindow.
The cursor and the track rectangle are also scrolled when they intersect
with the scrolled region.
Parameter Description
────────────────────────────────────────────────────────────────────────────
hwnd Identifies the window to scroll.
dx Specifies the amount of horizontal scrolling (in device units).
dy Specifies the amount of vertical scrolling (in device units).
prclScroll Points to a RECTL structure that specifies the scroll rectangle.
If prclScroll is NULL, the entire window will be scrolled.
prclClip Points to a RECTL structure that specifies the clip rectangle.
This structure takes precedence over the prclScroll rectangle.
Bits outside of the prclClip rectangle are not affected even if
they are in prclScroll.
hrgnUpdate Identifies the region that is modified to hold the region
invalidated by scrolling. This parameter may be NULL.
prclUpdate Points to a RECTL structure that receives the boundaries of the
rectangle invalidated by scrolling. This parameter may be NULL.
fs Specifies flags controlling the scrolling. It can be a
combination of the following values:
Value Meaning
────────────────────────────────────────────────────────────────
SW_SCROLLCHILDREN All child windows are scrolled.
SW_INVALIDATERGN The invalid region created as a result of
scrolling will be added to update regions of
those windows affected. This may result in
the sending of WM_PAINT messages to
WS_SYNCPAINT windows before the
WinScrollWindow function returns.
Return Value
The return value is a code indicating the type of invalid region created by
scrolling:
Value Meaning
────────────────────────────────────────────────────────────────────────────
ERROR Error in the passed region.
NULLREGION Scrolling produced no invalidation.
SIMPLEREGION Scrolling produced rectangular invalidation.
COMPLEXREGION Scrolling produced a nonrectangular invalidation.
Comments
To quickly repeat scrolling, omit the SW_INVALIDATERGN flag from the fs
parameter and accumulate the update area by specifying a region for the
hrgnUpdate parameter or a rectangle for the prclUpdate parameter. When
scrolling is completed, you can repaint the window by calling
WinInvalidateRegion or WinInvalidateRect, depending on whether you specified
the hrgnUpdate or prclUpdate parameter.
Typically, an application will set the SW_INVALIDATERGN flag in fs and let
the system handle the update regions of the affected windows. In this case,
the hrgnUpdate and prclUpdate parameters can both be set to NULL.
If the hwnd parameter does not have the WS_CLIPCHILDREN style, the bits of
any child window falling inside the scrolled area will also be scrolled. If
this is the case, WinScrollWindow should be called with SW_SCROLLCHILDREN.
The cursor and tracking rectangle are always hidden if they are in the
window being scrolled or a child of that window, and the cursor is always
offset by the distance scrolled. The tracking rectangle's position is left
alone. Both are then shown once scrolling is done.
See Also
GpiCombineRegion, RECTL, WM_PAINT
♦