Jump to content

BeginCloseDC

From EDM2
Revision as of 03:17, 31 December 2019 by Martini (talk | contribs) (Created page with "OS2_PM_DRV_ENABLE: BeginCloseDC is called to inform the presentation driver that the device context is being closed. ==Syntax== BeginCloseDC(ulSubfunction, hdcParam1, pPara...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

OS2_PM_DRV_ENABLE: BeginCloseDC is called to inform the presentation driver that the device context is being closed.

Syntax

BeginCloseDC(ulSubfunction, hdcParam1, pParam2);

Parameters

ulSubfunction (ULONG) - input
0Bh.
hdcParam1 (HDC) - input
A device context handle.
pParam2 (PLONG) - input
A pointer (pInstance) to the DC instance data.

Return Code

rc (LONG) - returns
Return codes.
The handling routine should return a LONG integer. Valid values are:
  • 0 Successful
  • -1 Error

Remarks

This is the last call made to the driver before it loses access to the graphics engine. Display drivers for the primary display device return Successful without taking any action. For other devices, the handling routine in the presentation driver has to close any resources (such as journal files and bit maps) that it owns.

Hardcopy drivers do not use the BeginCloseDC routine to complete tasks such as writing spool files. The tasks are completed in response to a call to GreEscape DEVESC_ENDDOC. The DEVESC_ENDDOC routine resets the DEVESC_STARTDOC flag in the instance data. The BeginCloseDC routine checks that the flag is reset before taking any action.

Sample Code

#include <os2.h>

ULONG    ulSubfunction;  /*  0Bh. */
HDC      hdcParam1;
PLONG    pParam2;        /*  A pointer (pInstance) to the DC instance data. */
LONG     rc;             /*  Return codes. */

rc = BeginCloseDC(ulSubfunction, hdcParam1, pParam2);