INT DrvDocumentEvent(
HANDLE hPrinter, | |
HDC hdc, | |
int iEsc, | |
ULONG cbIn, | |
PULONG pbIn, | |
ULONG cbOut, | |
PULONG pbOut | |
); |
DrvDocumentEvent allows the printer driver UI to hook certain printer management calls.
Escape |
Definition |
DOCUMENTEVENT_CREATEDCPRE |
User-mode GDI is calling DrvDocumentEvent before sending an
application’s CreateDC call to kernel-mode GDI for processing. |
DOCUMENTEVENT_CREATEDCPOST |
User-mode GDI is calling DrvDocumentEvent after kernel-mode GDI has
processed an application’s CreateDC call. |
DOCUMENTEVENT_RESETDCPRE |
User-mode GDI is calling DrvDocumentEvent before sending an
application’s ResetDC call to kernel-mode GDI for processing. |
DOCUMENTEVENT_RESETDCPOST |
User-mode GDI is calling DrvDocumentEvent after kernel-mode GDI has
processed an application’s ResetDC call. |
DOCUMENTEVENT_STARTDOCPRE |
User-mode GDI is calling DrvDocumentEvent before sending an
application’s StartDoc call to kernel-mode GDI for processing. |
DOCUMENTEVENT_STARTDOCPOST |
User-mode GDI is calling DrvDocumentEvent after kernel-mode GDI has
processed an application’s StartDoc call. |
DOCUMENTEVENT_STARTPAGE |
User-mode GDI is calling DrvDocumentEvent before sending an
application’s StartPage call to kernel-mode GDI for processing. |
DOCUMENTEVENT_ENDPAGE |
User-mode GDI is calling DrvDocumentEvent before sending an
application’s EndPage call to kernel-mode GDI for processing. |
DOCUMENTEVENT_ENDDOCPRE |
User-mode GDI is calling DrvDocumentEvent before sending an
application’s EndDoc call to kernel-mode GDI for processing. |
DOCUMENTEVENT_ENDDOCPOST |
User-mode GDI is calling DrvDocumentEvent after kernel-mode GDI has
processed an application’s EndDoc call. |
DOCUMENTEVENT_ABORTDOC |
User-mode GDI is calling DrvDocumentEvent before sending an
application’s AbortDoc call to kernel-mode GDI for processing. |
DOCUMENTEVENT_DELETEDC |
User-mode GDI is calling DrvDocumentEvent before sending an
application’s DeleteDC call to kernel-mode GDI for processing. |
DOCUMENTEVENT_ESCAPE |
User-mode GDI is calling DrvDocumentEvent before sending an
application’s ExtEscape call to kernel-mode GDI for processing. |
DrvDocumentEvent returns one of the following values:
Return Value |
Meaning |
DOCUMENTEVENT_SUCCESS |
The driver successfully handled the hooked call identified by iEsc. |
DOCUMENTEVENT_UNSUPPORTED |
The driver does not support the hooked call identified by iEsc. |
DOCUMENTEVENT_FAILURE |
The driver supports the hooked call identified by iEsc, but failed to handle the request. |
A printer driver UI can optionally implement DrvDocumentEvent to hook certain printer management calls made by an application to GDI. This enables the printer driver’s UI module to process data in user mode before GDI passes the call to kernel-mode, and to post-process the data returned from kernel-mode before GDI returns it to the application. DrvDocumentEvent is executed in the context of the application’s process.
GDI calls DrvDocumentEvent before sending the application call on to kernel-mode GDI when the escape code definition has no suffix or is suffixed with PRE. For those escape code definitions suffixed with POST, GDI calls DrvDocumentEvent after the call is processed by kernel-mode GDI but before the results are returned to the application.
A FAX driver can implement DrvDocumentEvent so that it displays a user interface dialog box upon a call to the Win32 StartDoc routine.