GreDeviceSelectBitmap

From EDM2
Jump to: navigation, search

GreDeviceSelectBitmap informs the presentation driver that a new bit map is selected into the device context. See also GreSelectBitmap.

This function must be supported by the presentation driver.

Simulation support
None. This function is mandatory for all drivers.

Syntax

GreDeviceSelectBitmap(hdc, hbm, pInstance, lFunction)

Parameters

hdc (HDC) - input
Device context handle.
hbm (ULONG) - input
Device bit-map handle.
pInstance (PVOID) - input
Pointer to instance data.
lFunction (ULONG) - input
High-order WORD=flags; low-order WORD=NGreDeviceSelectBitmap.

Returns

rc (BOOL) - returns 
Return Codes.
On completion, the handling routine must return a BOOLEAN value to indicate success or an error.
  • TRUE Successful
  • FALSE Error

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

Refer to the "Error Explanations" section in the Presentation Manager Programming Reference for further explanation.

Sample

#define INCL_GRE_BITMAPS
#include <os2.h>

HDC      hdc;        /*  Device context handle. */
ULONG    hbm;        /*  Device bit-map handle. */
PVOID    pInstance;  /*  Pointer to instance data. */
ULONG    lFunction;
BOOL     rc;         /*  Return Codes. */

rc = GreDeviceSelectBitmap(hdc, hbm, pInstance, lFunction);