The DEVMODEW structure is used for specifying characteristics of display and print devices.
typedef struct _devicemodew {
WCHAR dmDeviceName[CCHDEVICENAME];
WORD dmSpecVersion;
WORD dmDriverVersion;
WORD dmSize;
WORD dmDriverExtra;
DWORD dmFields;
union {
struct {
short dmOrientation;
short dmPaperSize;
short dmPaperLength;
short dmPaperWidth;
short dmScale;
short dmCopies;
short dmDefaultSource;
short dmPrintQuality;
};
struct {
POINTL dmPosition;
DWORD dmDisplayOrientation;
DWORD dmDisplayFixedOutput;
};
};
short dmColor;
short dmDuplex;
short dmYResolution;
short dmTTOption;
short dmCollate;
WCHAR dmFormName[CCHFORMNAME];
WORD dmLogPixels;
DWORD dmBitsPerPel;
DWORD dmPelsWidth;
DWORD dmPelsHeight;
union {
DWORD dmDisplayFlags;
DWORD dmNup;
};
DWORD dmDisplayFrequency;
DWORD dmICMMethod;
DWORD dmICMIntent;
DWORD dmMediaType;
DWORD dmDitherType;
DWORD dmReserved1;
DWORD dmReserved2;
DWORD dmPanningWidth;
DWORD dmPanningHeight;
} DEVMODEW, *PDEVMODEW, *NPDEVMODEW, *LPDEVMODEW;
For a printer, specifies the "friendly name"; for example, "PCL/HP LaserJet" in the case of PCL/HP LaserJet®. If the name is greater than CCHDEVICENAME characters in length, the spooler truncates it to fit in the array.
Display drivers can set this member to DM_SPECVERSION.
This member is not used for displays.
This member is not used for displays.
This member is not used for displays.
This member is not used for displays.
This member is not used for displays.
This member is not used for displays.
This member is not used for displays.
DMRES_HIGH
DMRES_MEDIUM
DMRES_LOW
DMRES_DRAFT
If a positive value is specified, it represents the number of dots per inch (DPI) for the x resolution, and the y resolution is specified by dmYResolution.
This member is not used for displays.
This member is not used for printers.
For displays, specifies the orientation at which images should be presented. When the DM_DISPLAYORIENTATION bit is not set in the dmFields member, this member must be set to zero. When the DM_DISPLAYORIENTATION bit is set in the dmFields member, this member must be set to one of the following values:
| Value | Meaning |
|---|---|
| DMDO_DEFAULT | The current mode's display device orientation is the natural orientation of the device, and should be used as the default. |
| DMDO_90 | The display device orientation is 90 degrees (measured clockwise) from that of DMDO_DEFAULT. |
| DMDO_180 | The display device orientation is 180 degrees (measured clockwise) from that of DMDO_DEFAULT. |
| DMDO_270 | The display device orientation is 270 degrees (measured clockwise) from that of DMDO_DEFAULT. |
This member is not used for printers.
For fixed-resolution displays, specifies how the device can present a lower-resolution mode on a higher-resolution display. For example, if a display device's resolution is fixed at 1024 X 768, and its mode is set to 640 x 480, the device can either display a 640 X 480 image within the 1024 X 768 screen space, or stretch the 640 X 480 image to fill the larger screen space.
When the DM_DISPLAYFIXEDOUTPUT bit is not set in the dmFields member, this member must be set to zero. When the DM_DISPLAYFIXEDOUTPUT bit is set in the dmFields member, this member must be set to one of the following values:
| Value | Meaning |
|---|---|
| DMDFO_CENTER | The display device presents a lower resolution mode image by centering it in the larger screen space. |
| DMDFO_STRETCH | The display device presents a lower-resolution mode image by stretching it to fill the larger screen space. |
This member is not used for printers.
This member is not used for displays.
This member is not used for displays.
This member is not used for displays.
This member is not used for displays.
Specifying DMCOLLATE_FALSE provides faster output because the data is sent to a printer only once, no matter how many copies are required.
This member is not used for displays.
This member is not used for displays.
This member is not used for printers.
This member is not used for printers.
This member is not used for printers.
This member is not used for printers.
This member is not used for printers.
| Value | Meaning |
|---|---|
| DMNUP_SYSTEM | The print system handles "N-up" printing. |
| DMNUP_ONEUP | The print system does not handle "N-up" printing. An application can set dmNup to DMNUP_ONEUP if it intends to carry out "N-up" printing on its own. |
This member is not used for displays.
This member is not used for printers.
Declared in wingdi.h. Include wingdi.h.
The DEVMODEW structure is the Unicode version of the DEVMODE structure (described in the Platform SDK documentation). While applications can use either the ANSI or Unicode version of the structure, drivers are required to use the Unicode version.
For printer drivers, the DEVMODEW structure is used for specifying printer characteristics required by a print document. It is also used for specifying a printer's default characteristics.
Immediately following a DEVMODEW structure's defined members (often referred to as its public members), there can be a set of driver-defined members (often referred to as private DEVMODEW members). The driver supplies the size, in bytes, of this private area in dmDriverExtra. Driver-defined private members are for exclusive use by the driver. The starting address for the private members can be referenced using the dmSize member as follows:
PVOID pvDriverData = (PVOID) (((BYTE *) pdm) + (pdm->dmSize));
Note In Windows 2000, a new union member was added to the DEVMODEW structure. This union member contains an existing DEVMODEW structure member, dmDisplayFlags, together with a new member, dmNup. This member is described in the preceding Members section.
In Windows XP, a new struct member was added. This struct member contains an existing DEVMODEW structure member, dmPosition, together with two new members, dmDisplayOrientation and dmDisplayFixedOutput. These members are described in the preceding Members section.
Also for Windows XP, several members of the DEVMODEW structure were moved to different locations in this structure. The dmScale, dmCopies, dmDefaultSource, and dmPrintQuality members were appended to the struct member containing the dmOrientation, dmPaperSize, dmPaperLength, and dmPaperWidth members.
DOCUMENTPROPERTYHEADER, DrvConvertDevMode, DrvDeviceCapabilities, DrvGetModes