Windows 3.1 Device Drivers (ddag31qh.hlp) (Table of Contents; Topic list)
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.
SET_CLIP_BOX
                                                     Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define SET_CLIP_BOX 4108 
short Control(lpDevice, SET_CLIP_BOX, lpClipBox, NULL)
LPPDEVICE lpDevice;
LPRECT lpClipBox;
 
The SET_CLIP_BOX escape sets the clipping rectangle or restores the previous
clipping rectangle. The SET_CLIP_BOX escape is required of any device driver
that implements the coordinate transformation escapes.
 
Parameter  Description
────────────────────────────────────────────────────────────────────────────
 
lpDevice   Points to a PDEVICE structure specifying the destination device.
 
lpClipBox  Points to a RECT structure that contains the bounding rectangle
           of the desired clipping area. If the lpClipBox parameter is not
           NULL, the previous clipping rectangle is saved, and the current
           clipping rectangle is set to the specified bounds. If lpClipBox
           is NULL, the previous clipping rectangle is restored.
 
Return Value
 
The return value is a Boolean value specifying whether or not the clipping
rectangle was properly set.
 
Comments
 
Drivers that implement the TRANSFORM_CTM, SAVE_CTM, and RESTORE_CTM escapes
must also implement this escape.
 
When an applications calls a GDI output function, GDI calculates a clipping
rectangle that bounds the primitive, and then passes both the primitive and
the clipping rectangle to the driver. The driver is expected to clip the
primitive to the specified bounding rectangle. However, when an application
uses the coordinate transformation escapes, the clipping rectangle that was
calculated by GDI is generally invalid.
 
The application can use the SET_CLIP_BOX escape to specify the correct
clipping rectangle when coordinate transformations are used.
 
See Also
 
RESTORE_CTM, SAVE_CTM, TRANSFORM_CTM, PDEVICE
 
 
                                      ♦