GreSaveScreenBits

GreSaveScreenBits saves a rectangle of screen bits.


 * Simulation support: This function is mandatory for display drivers. For other drivers, it is simulated by a handling routine in the graphics engine.

Syntax
GreSaveScreenBits(hdc, prclRect, pInstance, lFunction);

Parameters

 * hdc (HDC) - input
 * The device context handle.


 * prclRect (PRECTL) - input
 * A pointer to a screen rectangle defined in screen coordinates.


 * pInstance (PVOID) - input
 * A pointer to instance data.


 * lFunction (ULONG) - input
 * High-order WORD=flags; low-order WORD=NGreRestoreScreenBits.

Return Code

 * rc (ULONG) - returns
 * Return codes.


 * On completion, the handling routine must return a handle to the saved bits (hsbBits) or 0 to indicate that the bits were not saved or that an error occurred.


 * Possible Errors Detected: When an error is detected, the handling routine must call WinSetErrorInfo to post the condition. Error codes for conditions that the handling routine is expected to check include:


 * PMERR_DEV_FUNC_NOT_INSTALLED
 * PMERR_INV_HDC

Remarks
It is permissible to implement this function by returning 0 to indicate that the bits were not saved and, therefore, must be saved by the calling routine.

This function lets the user-interface routines improve the performance of dialog boxes.

Sample Code

 * 1) define INCL_GRE_BITMAPS
 * 2) include 

HDC      hdc;        /*  The device context handle. */ PRECTL   prclRect;   /*  A pointer to a screen rectangle defined in screen coordinates. */ PVOID    pInstance;  /*  A pointer to instance data. */ ULONG    lFunction;  /*  High-order WORD=flags; low-order WORD=NGreRestoreScreenBits. */ ULONG    rc;         /*  Return codes. */

rc = GreSaveScreenBits(hdc, prclRect, pInstance, lFunction); 