typedef struct _DEVMODEW { WCHAR 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; WCHAR dmFormName[CCHFORMNAME]; WORD dmLogPixels; DWORD dmBitsPerPel; DWORD dmPelsWidth; DWORD dmPelsHeight; DWORD dmDisplayFlags; DWORD dmDisplayFrequency; } DEVMODEW;
The DEVMODEW structure contains information about the device initialization and environment of a printer.
Value |
Meaning |
DMPAPER_LETTER |
Letter, 8-1/2 by 11 in. |
DMPAPER_LEGAL |
Legal, 8-1/2 by 14 in. |
DMPAPER_A4 |
A4 Sheet, 210 by 297 mm. |
DMPAPER_CSHEET |
C Sheet, 17 by 22 in. |
DMPAPER_DSHEET |
D Sheet, 22 by 34 in. |
DMPAPER_ESHEET |
E Sheet, 34 by 44 in. |
DMPAPER_LETTERSMALL |
Letter Small, 8-1/2 by 11 in. |
DMPAPER_TABLOID |
Tabloid, 11 by 17 in. |
DMPAPER_LEDGER |
Ledger, 17 by 11 in. |
DMPAPER_STATEMENT |
Statement, 5-1/2 by 8-1/2 in. |
DMPAPER_EXECUTIVE |
Executive, 7-1/4 by 10-1/2 in. |
DMPAPER_A3 |
A3 sheet, 297 by 420 mm. |
DMPAPER_A4SMALL |
A4 small sheet, 210 by 297 mm. |
DMPAPER_A5 |
A5 sheet, 148 by 210 mm. |
DMPAPER_B4 |
B4 sheet, 250 by 354 mm. |
DMPAPER_B5 |
B5 sheet, 182 by 257 mm. |
DMPAPER_FOLIO |
Folio, 8-1/2 by 13 in. |
DMPAPER_QUARTO |
Quarto, 215 by 275 mm. |
DMPAPER_10X14 |
10 by 14 in. |
DMPAPER_11X17 |
11 by 17 in. |
DMPAPER_NOTE |
Note, 8-1/2 by 11 in. |
DMPAPER_ENV_9 |
#9 Envelope, 3-7/8 by 8-7/8 in. |
DMPAPER_ENV_10 |
#10 Envelope, 4-1/8 by 9-1/2 in. |
DMPAPER_ENV_11 |
#11 Envelope, 4-1/2 by 10-3/8 in. |
DMPAPER_ENV_12 |
#12 Envelope, 4-3/4 by 11 in. |
DMPAPER_ENV_14 |
#14 Envelope, 5 by 11-1/2 in. |
DMPAPER_ENV_DL |
DL Envelope, 110 by 220 mm. |
DMPAPER_ENV_C5 |
C5 Envelope, 162 by 229 mm. |
DMPAPER_ENV_C3 |
C3 Envelope, 324 by 458 mm. |
DMPAPER_ENV_C4 |
C4 Envelope, 229 by 324 mm. |
DMPAPER_ENV_C6 |
C6 Envelope, 114 by 162 mm. |
DMPAPER_ENV_C65 |
C65 Envelope, 114 by 229 mm. |
DMPAPER_ENV_B4 |
B4 Envelope, 250 by 353 mm. |
DMPAPER_ENV_B5 |
B5 Envelope, 176 by 250 mm. |
DMPAPER_ENV_B6 |
B6 Envelope, 176 by 125 mm. |
DMPAPER_ENV_ITALY |
Italy Envelope, 110 by 230 mm. |
DMPAPER_ENV_MONARCH |
Monarch Envelope, 3-7/8 by 7-1/2 in. |
DMPAPER_ENV_PERSONAL |
6-3/4 Envelope, 3-5/8 by 6-1/2 in. |
DMPAPER_FANFOLD_US |
US Std Fanfold, 14-7/8 by 11 in. |
DMPAPER_FANFOLD_STD_GERMAN |
German Std Fanfold, 8-1/2 by 12 in. |
DMPAPER_FANFOLD_LGL_GERMAN |
German Legal Fanfold, 8-1/2 by 13 in. |
DMCOLOR_COLOR
DMCOLOR_MONOCHROME
DMDUP_SIMPLEX
DMDUP_HORIZONTAL
DMDUP_VERTICAL
Value |
Meaning |
DMTT_BITMAP |
Prints TrueType fonts as graphics. This is the default for dot-matrix printers. |
DMTT_DOWNLOAD |
Downloads TrueType fonts as soft fonts. This is the default for Hewlett-Packard printers that use Printer Control Language (PCL). |
DMTT_SUBDEV |
Substitute device fonts for TrueType fonts. This is the default for PostScript® printers. |
Value |
Meaning |
DMCOLLATE_TRUE |
Collate when printing multiple copies. |
DMCOLLATE_FALSE |
Do not collate when printing multiple copies. |
Specifying DMCOLLATE_FALSE provides faster output because the data is sent to
a printer only once, no matter how many copies are required.
Value |
Meaning |
DM_GRAYSCALE |
Specifies that the display is not a color device. If this flag is not set, color is assumed. |
DM_INTERLACED |
Specifies that the display mode is interlaced. If the flag is not set, noninterlaced is assumed. |
This structure is an extension of the Windows 3.1 DEVMODE structure.
A device driver’s private data follows the dmDisplayMode member. The number of bytes of private data is specified by the dmDriverExtra member.
An application can set several of these members, like dmCopies and dmOrientation, that are common among several drivers. This allows an application to make simple mode selections without calling the driver-supplied DrvDeviceModes function.
The DEVMODEW structure is followed immediately by dmDriverExtra bytes of driver data. This data is set only by DrvGetModes, and is therefore driver-defined. The driver should not assume that it can calculate the size of the DEVMODEW structure, but instead should use the size specified by the dmSize member.
The driver data begins at the address pointed to by:
PVOID pvDriverData = (PVOID) (((BYTE *) pdm) + (pdm->dmSize));