GdiGetDevmodeForPage function (winppi.h)

The GdiGetDevmodeForPage function returns DEVMODEW structures for the specified and previous pages of a print job.

Syntax

BOOL GdiGetDevmodeForPage(
  HANDLE    SpoolFileHandle,
  DWORD     dwPageNumber,
  PDEVMODEW *pCurrDM,
  PDEVMODEW *pLastDM
);

Parameters

SpoolFileHandle

Caller-supplied spool file handle, obtained by a previous call to GdiGetSpoolFileHandle.

dwPageNumber

Caller-supplied number of the page for which DEVMODEW contents are to be returned.

pCurrDM

Caller-supplied location to receive a pointer to a DEVMODE structure for the page specified by dwPageNumber.

pLastDM

Caller-supplied location to receive a pointer to a DEVMODE structure for the page previous to the one specified by dwPageNumber.

Return value

If the operation succeeds, the function returns TRUE. Otherwise it returns FALSE.

Remarks

The GdiGetDevmodeForPage function is exported by gdi32.dll for use within a print processor's PrintDocumentOnPrintProcessor function.

Before calling GdiPlayPageEMF to execute a page's EMF instructions, a print processor must call GdiGetDevmodeForPage to determine if the DEVMODE structure associated with the page to be printed is the same as that of the last page printed. If the two returned DEVMODE structures are not identical, the print processor must perform the following steps, in order, before calling GdiPlayPageEMF for the page:

  1. Call GdiEndPageEMF.
  2. Call GdiResetDCEMF, specifying the DEVMODE pointed to by pCurrDM.
  3. Call GdiStartPageEMF.
For additional information, see Using GDI Functions in Print Processors.

Requirements

Requirement Value
Target Platform Universal
Header winppi.h (include Winppi.h)
Library Gdi32.Lib
DLL Gdi32.dll