DEVMODE

This structure contains information about a printer environment and device initialization.

At a Glance

Header file: Wingdi.h
Windows CE versions: 2.0 and later

Syntax

typedef struct_devicemode {
BCHAR dmDeviceName[CCHDEVICENAME];
WORD dmSpecVersion;
WORD dmDriverVersion;
WORD dmSize;
WORD dmDriverExtra;
DWORD dmFields;
short dmOrientation;
short dmPaperSize;
short dmPaperLength;
short dmPaperWidth;
short dmScale;
short dmCopies;
short dmDefaultSource;
short dmPrintQuality;
short dmColor;
short dmDuplex;
short dmYResolution;
short dmTTOption;
short dmCollate;
BCHAR dmFormName[CCHFORMNAME];
WORD dmLogPixels;
DWORD dmBitsPerPel;
DWORD dmPelsWidth;
DWORD dmPelsHeight;
DWORD dmDisplayFlags;
DWORD dmDisplayFrequency;
DWORD dmICMMethod;
DWORD dmICMIntent;
DWORD dmMediaType;
DWORD dmDitherType;
DWORD dmICCManufacturer;
DWORD dmICCModel;
DWORD dmPanningWidth;
DWORD dmPanningHeight;
}
DEVMODE;

Members

dmDeviceName

Unsupported; set to zero.

dmSpecVersion

Specifies the version number of the initialization data specification on which the structure is based. Must be initialized to SPEC_VERSION.

dmDriverVersion

Unsupported; set to zero.

dmSize

Specifies the size, in bytes, of the DEVMODE structure, not including any private driver-specific data that might follow the structure’s public members. Set this member to sizeof(DEVMODE) to indicate the version of the DEVMODE structure being used.

dmDriverExtra

Unsupported; set to zero.

dmFields

Unsupported; set to zero.

dmOrientation

For printer devices only, specifies the orientation of the paper. It is either DMORIENT_PORTRAIT (1) or DMORIENT_LANDSCAPE (2).

dmPaperSize

For printer devices only, specifies the size of the paper to print on. This member is one of the following predefined values:

Value Description
DMPAPER_LETTER Letter, 8 1/2- by 11-inches
DMPAPER_A4 A4 Sheet, 210- by 297-millimeters

dmPaperLength
dmPaperWidth

Unsupported; set to zero.

dmScale

Unsupported; set to zero.

dmCopies

Unsupported; set to zero.

dmDefaultSource

Unsupported; set to zero.

dmPrintQuality

Specifies the printer resolution. The following are predefined device-independent values:

dmColor

Switches between color and monochrome on color printers. The following are possible values:

dmDuplex

Unsupported; set to zero.

dmYResolution

Unsupported; set to zero.

dmTTOption

Unsupported; set to zero.

dmCollate

Unsupported; set to zero.

dmFormName

 Unsupported; set to zero.

dmLogPixels

Unsupported; set to zero.

DmBitsPerPel
dmPelsWidth
dmPelsHeight

Unsupported; set to zero.

DmDisplayFlags
dmDisplayFrequency

Unsupported; set to zero.

DmICMMethod
dmICMIntent

Unsupported; set to zero.

DmMediaType
dmDitherType

Unsupported; set to zero.

DmPanningWidth
dmPanningHeight

Unsupported; set to zero.

Remarks

A device driver’s private data follows the public portion of the DEVMODE structure. The size of the public data can vary for different versions of the structure. The dmSize member specifies the number of bytes of public data, and the dmDriverExtra member specifies the number of bytes of private data.

All unsupported members should be initialized to zero.

See Also

CreateDC