SETPRINTERDC

  #define SETPRINTERDC 9    

  short Control(lpDevice, SETPRINTERDC, lphdc, NULL)    
  LPPDEVICE lpDevice;    
  LPHANDLE lphdc;    

The SETPRINTERDC escape saves the given device context for use in a subsequent call to the OpenJob function (GDI.240). GDI calls this escape whenever an application calls the StartDoc function (GDI.377) or the STARTDOC escape using the Escape function (GDI.38).

Printer drivers that call the OpenJob function to start a print job must support the SETPRINTERDC escape.

Parameters

lpDevice

Points to a PDEVICE structure specifying the device.

lphdc

Points to a device context handle for the application starting the print job.

Return Value

The return value is TRUE if the escape is successful. Otherwise, it is FALSE.

Comments

The SETPRINTERDC escape should save the device context handle in the
PDEVICE
structure and use it when calling the OpenJob function as part of
processing the STARTDOC escape.

See Also

STARTDOC