Important: |
---|
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. |
This structure contains information about a printer environment and device initialization.
Syntax
typedef struct_devicemode { 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; BCHAR dmFormName[CCHFORMNAME]; WORD dmLogPixels; DWORD dmBitsPerPel; DWORD dmPelsWidth; DWORD dmPelsHeight; DWORD dmDisplayFlags; DWORD dmDisplayFrequency; DWORD dmDisplayOrientation; } DEVMODE; |
Members
- dmDeviceName
-
String that specifies the friendly name of the printer.
This string is unique among device drivers.
This name can be truncated to fit in the dmDeviceNamearray.
- dmSpecVersion
-
Unsupported; set to zero.
- dmDriverVersion
-
Unsupported; set to zero.
- dmSize
-
WORDthat specifies the size, in bytes, of the DEVMODEstructure, not including any private driver-specific data that can follow the public members of the structure.
Set this member to sizeof( DEVMODE) to indicate the version of the DEVMODEstructure being used.
- dmDriverExtra
-
Contains the number of bytes of private driver-data that follow this structure.
If a device driver does not use device-specific information, set this member to zero.
- dmFields
-
DWORDthat specifies whether certain members of the DEVMODEstructure have been initialized.
If a member is initialized, its corresponding bit is set, otherwise the bit is clear.
A printer driver supports only those member of the DEVMODEstructure that are appropriate for the printer technology.
The following table shows the possible values.
Value Description DM_ORIENTATION
The dmOrientationmember is initialized.
DM_PAPERSIZE
The dmPaperSizemember is initialized.
DM_COPIES
The dmCopiesmember is initialized.
DM_PRINTQUALITY
The dmPrintQualitymember is initialized.
DM_COLOR
The dmColormember is initialized.
DM_BITSPERPEL
The dmBitsPerPelmember is initialized.
DM_PELSWIDTH
The dmPelsWidthmember is initialized.
DM_PELSHEIGHT
The dmPelsHeightmember is initialized.
DM_DISPLAYORIENTATION
The ChangeDisplaySetttingsExfunction should set or obtain the current screen orientation in the dmDisplayOrientationmember.
DM_DISPLAYQUERYORIENTATION
The ChangeDisplaySetttingsExfunction should query the display driver to determine whether it supports screen rotation.
- dmOrientation
-
Short integer that specifies the orientation of the paper for printer devices.
The following table shows the possible values.
Value Description DMORIENT_LANDSCAPE
Prints in landscape orientation.
DMORIENT_PORTRAIT
Prints in portrait orientation.
- dmPaperSize
-
Short integer that specifies the size of the paper for printer devices.
This following table shows the possible predefined values.
Value Description DMPAPER_A4
A4 sheet, 210 millimeters by 297 millimeters
DMPAPER_B4
B4 sheet, 250 millimeters by 354 millimeters
DMPAPER_B5
B5 sheet, 182 millimeters by 257 millimeters
DMPAPER_LEGAL
Legal, 8 1/2 inches by 14 inches
DMPAPER_LETTER
Letter, 8 1/2 inches by 11 inches
- dmPaperLength
-
Unsupported; set to zero.
- dmPaperWidth
-
Unsupported; set to zero.
- dmScale
-
Unsupported; set to zero.
- dmCopies
-
Short integer that specifies the number of copies that you want to print, if the device supports printing multiple copies.
- dmDefaultSource
-
Unsupported; set to zero.
- dmPrintQuality
-
Short integer that specifies the printer resolution.
The following table shows the possible predefined device-independent values.
Value Description DMRES_DRAFT
Draft quality
DMRES_HIGH
High quality
- dmColor
-
Short integer that specifies color or monochrome printing on color printers.
The following table shows the possible values.
Value Description DMCOLOR_COLOR
Color printing
DMCOLOR_MONOCHROME
Monochrome printing
- 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
-
DWORDthat specifies the color resolution, in bits per pixel, of the display device; for example, 4 bits for 16 colors, 8 bits for 256 colors, or 16 bits for 65,536 colors.
Display drivers use this member, but printer drivers do not.
- dmPelsWidth
-
DWORDthat specifies the width, in pixels, of the visible device surface.
Display drivers use this member, but printer drivers do not.
- dmPelsHeight
-
DWORDthat specifies the height, in pixels, of the visible device surface.
Display drivers use this member, but printer drivers do not.
- dmDisplayFlags
-
Unsupported; set to zero.
- dmDisplayFrequency
-
Unsupported; set to zero.
- dmDisplayOrientation
-
DWORDthat specifies the orientation of the screen.
The following table shows the possible values.
Value Description DMDO_0
The screen is rotated by 0 degrees.
DMDO_90
The screen is rotated by 90 degrees counterclockwise.
DMDO_180
The screen is rotated by 180 degrees.
DMDO_270
The screen is rotated by 270 degrees counterclockwise.
Remarks
The private data for a device driver follows the public portion of the DEVMODEstructure.
The size of the public data can vary for different versions of the structure.
The dmSizemember specifies the number of bytes of public data.
You should initialize all unsupported members with a value of zero.
Requirements
Header | windows.h |
Windows Embedded CE | Windows CE 2.0 and later |
Windows Mobile | Windows Mobile Version 5.0 and later |