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.
GetBlock
                                                     Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
The GetBlock function copies a rectangular area of the screen to a specified
buffer.
 
Parameter  Description
────────────────────────────────────────────────────────────────────────────
 
DS         Specifies the segment address of the grabber (CS and DS registers
           are equal).
 
ES:DI      Points to a GRABREQUEST structure defining the size and format of
           the block to capture.
 
Return Value
 
The return value is the number of bytes transferred and is set in the AX
register if successful. The carry flag is cleared as well. Otherwise, the
return value is one of the following error values.
 
Value                   Meaning
────────────────────────────────────────────────────────────────────────────
ERR_UNSUPPORTED (0FFh)  Block operation not supported.
 
ERR_BOUNDARY (0FEh)     Source or destination range in error.
 
Comments
 
If the grlpData member is NULL, GetBlock returns the number of bytes to copy
without actually copying the bytes.
 
GetBlock uses only the Format value of the grStyle member. If the Format
value in grStyle is FMT_NATIVE, GetBlock copies the data in the native
screen format for the current video context. Thus, text screens result in
character and attribute pairs being copied, while graphics screens result in
a bitmap. Since the native format is screen dependent, use it for saving and
restoring; don't attempt to interpret the data.
 
If the Format value is FMT_OTHER, GetBlock copies the data in a variant of
the Windows clipboard format defined by the grabber-buffer structure,
GRABST. This buffer has GT_TEXT type for text screens and GT_NEWBITMAP type
for graphics screens.
 
GetBlock does not use the grChar and grAttr members.
 
In text mode, the display adapter may contain multiple character sets or
allow downloadable character sets. The data returned in clipboard format
will be translated to the standard OEM set if it can be determined that
another set is in use, which character set it is, and whether or not a
translation table is available for the job. The EGA is an example of an
adapter that makes it hard to determine that a set has been downloaded and
practically impossible to determine which one it is.
 
See Also
 
GRABREQUEST, GRABST