The DEVMODE data structure contains information about the device initialization and environment of a printer.
typedef struct _devicemode { // dvmd
BCHAR dmDeviceName[CCHDEVICENAME];
WORD dmSpecVersion;
WORD dmDriverVersion;
WORD dmSize;
WORD dmDriverExtra;
DWORD dmFields;
union {
struct {
short dmOrientation;
short dmPaperSize;
short dmPaperLength;
short dmPaperWidth;
};
POINTL dmPosition;
};
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;
#if(WINVER >= 0x0400)
DWORD dmICMMethod;
DWORD dmICMIntent;
DWORD dmMediaType;
DWORD dmDitherType;
DWORD dmReserved1;
DWORD dmReserved2;
#if (WINVER >= 0x0500) || (_WIN32_WINNT >= 0x0400)
DWORD dmPanningWidth;
DWORD dmPanningHeight;
#endif
#endif /* WINVER >= 0x0400 */
} DEVMODE;
The following bit flags are defined, and are listed here with the corresponding structure members:
Value | Structure Member |
---|---|
DM_ORIENTATION | dmOrientation |
DM_PAPERSIZE | dmPaperSize |
DM_PAPERLENGTH | dmPaperLength |
DM_PAPERWIDTH | dmPaperWidth |
DM_POSITION | dmPosition |
DM_SCALE | dmScale |
DM_COPIES | dmCopies |
DM_DEFAULTSOURCE | dmDefaultSource |
DM_PRINTQUALITY | dmPrintQuality |
DM_COLOR | dmColor |
DM_DUPLEX | dmDuplex |
DM_YRESOLUTION | dmYResolution |
DM_TTOPTION | dmTTOption |
DM_COLLATE | dmCollate |
DM_FORMNAME | dmFormName |
DM_LOGPIXELS | dmLogPixels |
DM_BITSPERPEL | dmBitsPerPel |
DM_PELSWIDTH | dmPelsWidth |
DM_PELSHEIGHT | dmPelsHeight |
DM_DISPLAYFLAGS | dmDisplayFlags |
DM_DISPLAYFREQUENCY | dmDisplayFrequency |
DM_ICMMETHOD | dmICMMethod |
DM_ICMINTENT | dmICMIntent |
DM_MEDIATYPE | dmMediaType |
DM_DITHERTYPE | dmDitherType |
DM_PANNINGWIDTH | Windows NT 5.0 and later: dmPanningWidth |
DM_PANNINGHEIGHT | Windows NT 5.0 and later: dmPanningHeight |
Value | Meaning |
---|---|
DMPAPER_LETTER | Letter, 8 1/2- by 11-inches |
DMPAPER_LEGAL | Legal, 8 1/2- by 14-inches |
DMPAPER_A4 | A4 Sheet, 210- by 297-millimeters |
DMPAPER_CSHEET | C Sheet, 17- by 22-inches |
DMPAPER_DSHEET | D Sheet, 22- by 34-inches |
DMPAPER_ESHEET | E Sheet, 34- by 44-inches |
DMPAPER_LETTERSMALL | Letter Small, 8 1/2- by 11-inches |
DMPAPER_TABLOID | Tabloid, 11- by 17-inches |
DMPAPER_LEDGER | Ledger, 17- by 11-inches |
DMPAPER_STATEMENT | Statement, 5 1/2- by 8 1/2-inches |
DMPAPER_EXECUTIVE | Executive, 7 1/4- by 10 1/2-inches |
DMPAPER_A3 | A3 sheet, 297- by 420-millimeters |
DMPAPER_A4SMALL | A4 small sheet, 210- by 297-millimeters |
DMPAPER_A5 | A5 sheet, 148- by 210-millimeters |
DMPAPER_B4 | B4 sheet, 250- by 354-millimeters |
DMPAPER_B5 | B5 sheet, 182- by 257-millimeter paper |
DMPAPER_FOLIO | Folio, 8 1/2- by 13-inch paper |
DMPAPER_QUARTO | Quarto, 215- by 275-millimeter paper |
DMPAPER_10X14 | 10- by 14-inch sheet |
DMPAPER_11X17 | 11- by 17-inch sheet |
DMPAPER_NOTE | Note, 8 1/2- by 11-inches |
DMPAPER_ENV_9 | #9 Envelope, 3 7/8- by 8 7/8-inches |
DMPAPER_ENV_10 | #10 Envelope, 4 1/8- by 9 1/2-inches |
DMPAPER_ENV_11 | #11 Envelope, 4 1/2- by 10 3/8-inches |
DMPAPER_ENV_12 | #12 Envelope, 4 3/4- by 11-inches |
DMPAPER_ENV_14 | #14 Envelope, 5- by 11 1/2-inches |
DMPAPER_ENV_DL | DL Envelope, 110- by 220-millimeters |
DMPAPER_ENV_C5 | C5 Envelope, 162- by 229-millimeters |
DMPAPER_ENV_C3 | C3 Envelope, 324- by 458-millimeters |
DMPAPER_ENV_C4 | C4 Envelope, 229- by 324-millimeters |
DMPAPER_ENV_C6 | C6 Envelope, 114- by 162-millimeters |
DMPAPER_ENV_C65 | C65 Envelope, 114- by 229-millimeters |
DMPAPER_ENV_B4 | B4 Envelope, 250- by 353-millimeters |
DMPAPER_ENV_B5 | B5 Envelope, 176- by 250-millimeters |
DMPAPER_ENV_B6 | B6 Envelope, 176- by 125-millimeters |
DMPAPER_ENV_ITALY | Italy Envelope, 110- by 230-millimeters |
DMPAPER_ENV_MONARCH | Monarch Envelope, 3 7/8- by 7 1/2-inches |
DMPAPER_ENV_PERSONAL | 6 3/4 Envelope, 3 5/8- by 6 1/2-inches |
DMPAPER_FANFOLD_US | US Std Fanfold, 14 7/8- by 11-inches |
DMPAPER_FANFOLD_STD_GERMAN | German Std Fanfold, 8 1/2- by 12-inches |
DMPAPER_FANFOLD_LGL_GERMAN | German Legal Fanfold, 8 1/2- by 13-inches |
This member can be one of the following values, or it can be a device-specific value greater than DMBIN_USER.
DMBIN_ONLYONE
DMBIN_LOWER
DMBIN_MIDDLE
DMBIN_MANUAL
DMBIN_ENVELOPE
DMBIN_ENVMANUAL
DMBIN_AUTO
DMBIN_TRACTOR
DMBIN_SMALLFMT
DMBIN_LARGEFMT
DMBIN_LARGECAPACITY
DMBIN_CASSETTE
DMBIN_FORMSOURCE
DMRES_HIGH
DMRES_MEDIUM
DMRES_LOW
DMRES_DRAFT
If a positive value is given, it specifies the number of dots per inch (DPI) and is therefore device dependent.
DMCOLOR_COLOR
DMCOLOR_MONOCHROME
DMDUP_SIMPLEX
DMDUP_HORIZONTAL
DMDUP_VERTICAL
Value | Meaning |
---|---|
DMTT_BITMAP | Prints TrueType fonts as graphics. This is the default action for dot-matrix printers. |
DMTT_DOWNLOAD | Downloads TrueType fonts as soft fonts. This is the default action for Hewlett-Packard printers that use Printer Control Language (PCL). |
DMTT_SUBDEV | Substitute device fonts for TrueType fonts. This is the default action for PostScript® printers. |
Value | Meaning |
---|---|
DMCOLLATE_TRUE | Collate when printing multiple copies. |
DMCOLLATE_FALSE | Do not collate when printing multiple copies. |
Using DMCOLLATE_TRUE provides faster, more efficient output for collation, since the data is sent to the device driver just once, no matter how many copies are required. The printer is told to simply print the page again.
Windows 95: Printer drivers do not use this member.
Value | Meaning |
---|---|
DM_GRAYSCALE | Specifies that the display is a noncolor 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. |
Display drivers use this member, for example, in the ChangeDisplaySettings function. Printer drivers do not use this member.
When you call the EnumDisplaySettings function, the dmDisplayFrequency member may return with the value 0 or 1. These values represent the display hardware's default refresh rate. This default rate is typically set by switches on a display card or computer motherboard, or by a configuration program that does not use Win32 display functions such as ChangeDisplaySettings.
Value | Meaning |
---|---|
DMICMMETHOD_NONE | Specifies that ICM is disabled. |
DMICMMETHOD_SYSTEM | Specifies that ICM is handled by Windows. |
DMICMMETHOD_DRIVER | Specifies that ICM is handled by the device driver. |
DMICMMETHOD_DEVICE | Specifies that ICM is handled by the destination device. |
The printer driver must provide a user interface for setting this member. Most printer drivers support only the DMICMMETHOD_SYSTEM or DMICMMETHOD_NONE value. Drivers for PostScript printers support all values.
Value | Meaning |
---|---|
DMICM_SATURATE | Color matching should optimize for color saturation. This value is the most appropriate choice for business graphs when dithering is not desired. |
DMICM_CONTRAST | Color matching should optimize for color contrast. This value is the most appropriate choice for scanned or photographic images when dithering is desired. |
DMICM_COLORMETRIC | Color matching should optimize to match the exact color requested. This value is most appropriate for use with business logos or other images when an exact color match is desired. |
Value | Meaning |
---|---|
DMMEDIA_STANDARD | Plain paper. |
DMMEDIA_GLOSSY | Glossy paper. |
DMMEDIA_TRANSPARENCY | Transparent film. |
Value | Meaning |
---|---|
DMDITHER_NONE | No dithering. |
DMDITHER_COARSE | Dithering with a coarse brush. |
DMDITHER_FINE | Dithering with a fine brush. |
DMDITHER_LINEART | Line art dithering, a special dithering method that produces well defined borders between black, white, and gray scalings. It is not suitable for images that include continuous graduations in intensisty and hue such as scanned photographs. |
DMDITHER_GRAYSCALE | Device does grayscaling. |
Windows 95 and later: This member is not supported.
Windows 95 and later: This member is not supported.
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.
Windows NT: Requires version 3.1 or later.
Windows: Requires Windows 95 or later.
Windows CE: Unsupported.
Header: Declared in wingdi.h.
Unicode: Defined as Unicode and ANSI structures.
Printing and Print Spooler Overview, Printing and Print Spooler Structures, AdvancedDocumentProperties, ChangeDisplaySettings, CreateDC, CreateIC, DeviceCapabilities, DocumentProperties, EnumDisplaySettings, OpenPrinter