DEVMODE Structure

Type DEVMODE
	dmDeviceName As String * 32
	dmSpecVersion As Integer
	dmDriverVersion As Integer
	dmSize As Integer
	dmDriverExtra As Integer
	dmFields As Long
	dmOrientation As Integer
	dmPaperSize As Integer
	dmPaperLength As Integer
	dmPaperWidth As Integer
	dmScale As Integer
	dmCopies As Integer
	dmDefaultSource As Integer
	dmPrintQuality As Integer
	dmColor As Integer
	dmDuplex As Integer
	dmYResolution As Integer
	dmTTOption As Integer
	dmCollate As Integer
	dmFormName As String * 32
	dmUnusedPadding As Integer
	dmBitsPerPixel As Integer
	dmPelsWidth As Long
	dmPelsHeight As Long
	dmDisplayFlags As Long
	dmDisplayFrequency As Long
	' The following only appear in Windows 95, 98, 2000
	dmICMMethod As Long
	dmICMIntent As Long
	dmMediaType As Long
	dmDitherType As Long
	dmReserved1 As Long
	dmReserved2 As Long
	' The following only appear in Windows 2000
	dmPanningWidth As Long
	dmPanningHeight As Long
End Type

Description & Usage

The DEVMODE structure stores information about various settings and properties of a device, such as a printer. Some of the properties only apply to certain devices; for example, the dmDisplayFrequency has no relevant meaning for a printer. To determine which data members of the structure contain useful information, check the flags set in dwFields.

Visual Basic-Specific Information

None.

Data Members

dmDeviceName
The name of the device.
dmSpecVersion
The version number of the device's initialization information specification.
dmDriverVersion
The version number of the device driver.
dmSize
The size of the structure, in bytes.
dmDriverExtra
The number of bytes of information trailing the structure in memory.
dmFields
A combination of the following flags specifying which of the rest of the structure's members contain information about the device:
DM_ORIENTATION
dmOrientation contains information.
DM_PAPERSIZE
dmPaperSize contains information.
DM_PAPERLENGTH
dmPaperLength contains information.
DM_PAPERWIDTH
dmPaperWidth contains information.
DM_SCALE
dmScale contains information.
DM_COPIES
dmCopies contains information.
DM_DEFAULTSOURCE
dmDefaultSource contains information.
DM_PRINTQUALITY
dmPrintQuality contains information.
DM_COLOR
dmColor contains information.
DM_DUPLEX
dmDuplex contains information.
DM_YRESOLUTION
dmYResolution contains information.
DM_TTOPTION
dmTTOption contains information.
DM_COLLATE
dmCollate contains information.
DM_FORMNAME
dmFormName contains information.
DM_LOGPIXELS
dmLogPixels contains information.
DM_BITSPERPEL
dmBitsPerPel contains information.
DM_PELSWIDTH
dmPelsWidth contains information.
DM_PELSHEIGHT
dmPelsHeight contains information.
DM_DISPLAYFLAGS
dmDisplayFlags contains information.
DM_DISPLAYFREQUENCY
dmDisplayFrequency contains information.
DM_ICMMETHOD
Win 95/98 only: dmICMMethod contains information.
DM_ICMINTENT
Windows 95, 98, 2000: dmICMIntent contains information.
DM_MEDIATYPE
Windows 95, 98, 2000: dmMediaType contains information.
DM_DITHERTYPE
Windows 95, 98, 2000: dmDitherType contains information.
DM_PANNINGWIDTH
Windows 2000: dmPanningWidth contains information.
DM_PANNINGHEIGHT
Windows 2000: dmPanningHeight contains information.
dmOrientation
One of the following flags specifying the orientation of the printer paper:
DMORIENT_PORTRAIT
Portrait (tall) mode.
DMORIENT_LANDSCAPE
Landscape (wide) mode.
dmPaperSize
If nonzero, one of the following flags specifying the size of the printer paper (or some other value specifying a paper size). If zero, the paper size is determined by dmPaperLength and dmPaperWidth.
DMPAPER_LETTER
Letter, 8.5 x 11 inches.
DMPAPER_LEGAL
Legal, 8.5 x 14 inches.
DMPAPER_10X11
10 x 11 inches.
DMPAPER_10X14
10 x 14 inches.
DMPAPER_11X17
11 x 17 inches.
DMPAPER_15X11
15 x 11 inches.
DMPAPER_9X11
9 x 11 inches.
DMPAPER_A_PLUS
A plus sheet.
DMPAPER_A2
A2 sheet.
DMPAPER_A3
A3 sheet, 297 x 420 millimeters.
DMPAPER_A3_EXTRA
A3 extra sheet.
DMPAPER_A3_EXTRA_TRANSVERSE
A3 extra transverse sheet.
DMPAPER_A3_TRANSVERSE
A3 transverse sheet.
DMPAPER_A4
A4 sheet, 210 x 297 millimeters.
DMPAPER_A4_EXTRA
A4 extra sheet.
DMPAPER_A4_PLUS
A4 plus sheet.
DMPAPER_A4_TRANSVERSE
A4 transverse sheet.
DMPAPER_A4SMALL
A4 small sheet, 210 x 297 millimeters.
DMPAPER_A5
A5 sheet, 148 x 210 millimeters.
DMPAPER_A5_EXTRA
A5 extra sheet.
DMPAPER_A5_TRANSVERSE
A5 transverse sheet.
DMPAPER_B_PLUS
B plus sheet.
DMPAPER_B4
B4 sheet, 250 x 354 millimeters.
DMPAPER_B5
B5 sheet, 192 x 257 millimeters.
DMPAPER_B5_EXTRA
B5 extra sheet.
DMPAPER_B5_TRANSVERSE
B5 transverse sheet.
DMPAPER_CSHEET
C sheet, 17 x 22 inches.
DMPAPER_DSHEET
D sheet, 22 x 34 inches.
DMPAPER_ENV_10
#10 envelope, 4.125 x 9.5 inches.
DMPAPER_ENV_11
#11 envelope, 4.5 x 10.375 inches.
DMPAPER_ENV_12
#12 envelope, 4.75 x 11 inches.
DMPAPER_ENV_14
#14 envelope, 5 x 11.5 inches.
DMPAPER_ENV_9
#9 envelope, 3.875 x 8.875 inches.
DMPAPER_ENV_B4
B4 envelope, 250 x 353 millimeters.
DMPAPER_ENV_B5
B5 envelope, 176 x 250 millimeters.
DMPAPER_ENV_B6
B6 envelope, 176 x 125 millimeters.
DMPAPER_ENV_C3
C3 envelope, 324 x 458 millimeters.
DMPAPER_ENV_C4
C4 envelope, 229 x 324 millimeters.
DMPAPER_ENV_C5
C5 envelope, 162 x 229 millimeters.
DMPAPER_ENV_C6
C6 envelope, 114 x 162 millimeters.
DMPAPER_ENV_C65
C65 envelope, 114 x 229 millimeters.
DMPAPER_ENV_DL
DL envelope, 110 x 220 millimeters.
DMPAPER_ENV_INVITE
Invitation envelope.
DMPAPER_ENV_ITALY
Italy envelope, 110 x 230 millimeters.
DMPAPER_ENV_MONARCH
Monarch envelope, 3.875 x 7.5 inches.
DMPAPER_ENV_PERSONAL
Personal (6.75) envelope, 3.625 x 6.5 inches.
DMPAPER_ESHEET
E sheet, 34 x 44 inches.
DMPAPER_EXECUTIVE
Executive, 7.25 x 10.5 inches.
DMPAPER_FANFOLD_LGL_GERMAN
German legal fanfold, 8.5 x 13 inches.
DMPAPER_FANFOLD_STD_GERMAN
German standard fanfold, 8.5 x 12 inches.
DMPAPER_FANFOLD_US
US standard fanfold, 14.875 x 11 inches.
DMPAPER_FIRST
Same as DMPAPER_LETTER.
DMPAPER_FOLIO
Folio, 8.5 x 13 inches.
DMPAPER_ISO_B4
ISO B4 sheet.
DMPAPER_JAPANESE_POSTCARD
Japanese postcard.
DMPAPER_LAST
Same as DMPAPER_FANFOLD_LGL_GERMAN.
DMPAPER_LEDGER
Ledger, 17 x 11 inches.
DMPAPER_LEGAL_EXTRA
Legal extra.
DMPAPER_LETTER_EXTRA
Letter extra.
DMPAPER_LETTER_EXTRA_TRANSVERSE
Letter extra transverse.
DMPAPER_LETTER_PLUS
Letter plus.
DMPAPER_LETTER_TRANSVERSE
Letter transverse.
DMPAPER_LETTERSMALL
Letter small, 8.5 x 11 inches.
DMPAPER_NOTE
Note, 8.5 x 11 inches.
DMPAPER_QUARTO
Quarto, 215 x 275 millimeters.
DMPAPER_STATEMENT
Statement, 5.5 x 8.5 inches.
DMPAPER_TABLOID
Tabloid, 11 x 17 inches.
DMPAPER_TABLOID_EXTRA
Tabloid extra.
DMPAPER_USER
User-defined size.
dmPaperLength
The length of the printer paper, measured in tenths of a millimeter.
dmPaperWidth
The width of the printer paper, measured in tenths of a millimeter.
dmScale
The scale percentage factor (e.g., 100 means 100%, or no, scaling; 200 means two times the size, etc.).
dmCopies
The number of document copies to print, if the device supports it.
dmDefaultSource
One of the following flags specifying the printer's source of paper:
DMBIN_ONLYONE
There is only one paper source.
DMBIN_UPPER
Upper bin.
DMBIN_LOWER
Lower bin.
DMBIN_MIDDLE
Middle bin.
DMBIN_MANUAL
Manual loading.
DMBIN_ENVELOPE
Envelope bin.
DMBIN_ENVMANUAL
Manual-loading envelope.
DMBIN_AUTO
Automatic loading.
DMBIN_TRACTOR
Tractor loading.
DMBIN_SMALLFMT
Small format loading.
DMBIN_LARGEFMT
Large format loading.
DMBIN_LARGECAPACITY
Large-capacity bin.
DMBIN_CASSETTE
Cassette.
DMBIN_FORMSOURCE
Form paper source.
dmPrintQuality
Either one of the following flags specifying the printer's print quality setting, or a positive value specifying the printer's dots per inch (DPI) rating.
DMRES_DRAFT
Draft-quality output.
DMRES_LOW
Low-quality output.
DMRES_MEDIUM
Medium-quality output.
DMRES_HIGH
High-quality output.
dmColor
One of the following flags specifying whether the device supports color:
DMCOLOR_MONOCHROME
The device does not support color output.
DMCOLOR_COLOR
The device supports color output.
dmDuplex
One of the following flags specifying the printer's double-sided (duplex) printing capability:
DMDUP_SIMPLEX
Configured for single-sided printing.
DMDUP_VERTICAL
Configured for double-sided printing with vertical page turning.
DMDUP_HORIZONTAL
Configured for double-sided printing with horizontal page turning.
dmYResolution
The number of the vertical dots per inch of the printer. If this value contains useful data, the number of horizontal dots per inch is inside dmPrintQuality.
dmTTOption
One of the following flags specifying how the printer prints TrueType fonts:
DMTT_BITMAP
The printer prints TrueType fonts as graphics (default for dot-matrix printers).
DMTT_DOWNLOAD
The printer downloads TrueType fonts as soft fonts (default for Hewlett-Packerd printers using Printer Control Language).
DMTT_SUBDEV
The printer substitutes device fonts for TrueType fonts (default for PostScript printers).
dmUnusedPadding
Reserved -- set to 0. This member merely takes up space to align other members in memory.
dmCollate
One of the following flags specifying whether the printer can collate copies:
DMCOLLATE_FALSE
Does not collate pages when printing multiple copies.
DMCOLLATE_TRUE
Does collate pages when printing multiple copies.
dmFormName
Windows NT, 2000: The name of the type of paper loaded in the printer.
dmBitsPerPel
The number of color bits used per pixel on the display device.
dmPelsWidth
The width of the display, measured in pixels.
dmPelsHeight
The height of the display, measured in pixels.
dmDisplayFlags
A combination of the following flags specifying the device's display mode:
DM_GRAYSCALE
The display does not support color. (If this flag is omitted, assume color is supported.)
DM_INTERLACED
The display is interlaced.
dmDisplayFrequency
The display frequency of the display, measured in Hz.
dmICMMethod
Windows 95, 98, 2000: Either one of the following flags specifying how image color matching (ICM) is supported, or a device-defined value greater than 256:
DMICMMETHOD_NONE
ICM is disabled.
DMICMMETHOD_SYSTEM
ICM is handled by Windows.
DMICMMETHOD_DRIVER
ICM is handled by the device driver.
DMICMMETHOD_DEVICE
ICM is handled by the device.
dmICMIntent
Windows 95, 98, 2000: Either one of the following flags specifying the image color matching (ICM) method used when ICM is not intrinsically supported, or a device-defined value greater than 256:
DMICM_SATURATE
Color matching attempts to optimize color saturation.
DMICM_CONTRAST
Color matching attempts to optimize color contrast.
DMICM_COLORMETRIC
Color matching attempts to match the exact color requested.
dmMediaType
Windows 95, 98, 2000: Either one of the following flags specifying what type of medium the printer is printing on, or a device-defined value greater than 256:
DMMEDIA_STANDARD
Plain paper.
DMMEDIA_GLOSSY
Glossy paper.
DMMEDIA_TRANSPARECNY
Transparent film.
dmDitherType
Windows 95, 98, 2000: Either one of the following flags specifying the dithering method used by the device, or a device-defined value greater than 256:
DMDITHER_NONE
No dithering.
DMDITHER_COARSE
Dithering with a coarse brush.
DMDITHER_FINE
Dithering with a fine brush.
DMDITHER_LINEART
Line art dithering, which makes well-defined borders between black, white, and gray.
DMDITHER_GRAYSCALE
Grayscaling.
dmReserved1
Windows 95, 98, 2000: Reserved -- set to 0.
dmReserved2
Windows 95, 98, 2000: Reserved -- set to 0.
dmPanningWidth
Windows 2000: Reserved -- set to 0.
dmPanningHeight
Windows 2000: Reserved -- set to 0.

Constant Definitions

Const DM_ORIENTATION = &H1
Const DM_PAPERSIZE = &H2
Const DM_PAPERLENGTH = &H4
Const DM_PAPERWIDTH = &H8
Const DM_SCALE = &H10
Const DM_COPIES = &H100
Const DM_DEFAULTSOURCE = &H200
Const DM_PRINTQUALITY = &H400
Const DM_COLOR = &H800
Const DM_DUPLEX = &H1000
Const DM_YRESOLUTION = &H2000
Const DM_TTOPTION = &H4000
Const DM_COLLATE = &H8000
Const DM_FORMNAME = &H10000
Const DM_LOGPIXELS = &H20000
Const DM_BITSPERPEL = &H40000
Const DM_PELSWIDTH = &H80000
Const DM_PELSHEIGHT = &H100000
Const DM_DISPLAYFLAGS = &H200000
Const DM_DISPLAYFREQUENCY = &H400000
Const DM_ICMMETHOD = &H800000
Const DM_ICMINTENT = &H1000000
Const DM_MEDIATYPE = &H2000000
Const DM_DITHERTYPE = &H4000000
Const DM_PANNINGWIDTH = &H20000000
Const DM_PANNINGHEIGHT = &H40000000
Const DMORIENT_PORTRAIT = 1
Const DMORIENT_LANDSCAPE = 2
Const DMPAPER_LETTER = 1
Const DMPAPER_LEGAL = 5
Const DMPAPER_10X11 = 45
Const DMPAPER_10X14 = 16
Const DMPAPER_11X17 = 17
Const DMPAPER_15X11 = 46
Const DMPAPER_9X11 = 44
Const DMPAPER_A_PLUS = 57
Const DMPAPER_A2 = 66
Const DMPAPER_A3 = 8
Const DMPAPER_A3_EXTRA = 63
Const DMPAPER_A3_EXTRA_TRANSVERSE = 68
Const DMPAPER_A3_TRANSVERSE = 67
Const DMPAPER_A4 = 9
Const DMPAPER_A4_EXTRA = 53
Const DMPAPER_A4_PLUS = 60
Const DMPAPER_A4_TRANSVERSE = 55
Const DMPAPER_A4SMALL = 10
Const DMPAPER_A5 = 11
Const DMPAPER_A5_EXTRA = 64
Const DMPAPER_A5_TRANSVERSE = 61
Const DMPAPER_B_PLUS = 58
Const DMPAPER_B4 = 12
Const DMPAPER_B5 = 13
Const DMPAPER_B5_EXTRA = 65
Const DMPAPER_B5_TRANSVERSE = 62
Const DMPAPER_CSHEET = 24
Const DMPAPER_DSHEET = 25
Const DMPAPER_ENV_10 = 20
Const DMPAPER_ENV_11 = 21
Const DMPAPER_ENV_12 = 22
Const DMPAPER_ENV_14 = 23
Const DMPAPER_ENV_9 = 19
Const DMPAPER_ENV_B4 = 33
Const DMPAPER_ENV_B5 = 34
Const DMPAPER_ENV_B6 = 35
Const DMPAPER_ENV_C3 = 29
Const DMPAPER_ENV_C4 = 30
Const DMPAPER_ENV_C5 = 28
Const DMPAPER_ENV_C6 = 31
Const DMPAPER_ENV_C65 = 32
Const DMPAPER_ENV_DL = 27
Const DMPAPER_ENV_INVITE = 47
Const DMPAPER_ENV_ITALY = 36
Const DMPAPER_ENV_MONARCH = 37
Const DMPAPER_ENV_PERSONAL = 38
Const DMPAPER_ESHEET = 26
Const DMPAPER_EXECUTIVE = 7
Const DMPAPER_FANFOLD_LGL_GERMAN = 41
Const DMPAPER_FANFOLD_STD_GERMAN = 40
Const DMPAPER_FANFOLD_US = 39
Const DMPAPER_FIRST = 1
Const DMPAPER_FOLIO = 14
Const DMPAPER_ISO_B4 = 42
Const DMPAPER_JAPANESE_POSTCARD = 43
Const DMPAPER_LAST = 41
Const DMPAPER_LEDGER = 4
Const DMPAPER_LEGAL_EXTRA = 51
Const DMPAPER_LETTER_EXTRA = 50
Const DMPAPER_LETTER_EXTRA_TRANSVERSE = 56
Const DMPAPER_LETTER_PLUS = 59
Const DMPAPER_LETTER_TRANSVERSE = 54
Const DMPAPER_LETTERSMALL = 2
Const DMPAPER_NOTE = 18
Const DMPAPER_QUARTO = 15
Const DMPAPER_STATEMENT = 6
Const DMPAPER_TABLOID = 3
Const DMPAPER_TABLOID_EXTRA = 52
Const DMPAPER_USER = 256
Const DMBIN_ONLYONE = 1
Const DMBIN_UPPER = 1
Const DMBIN_LOWER = 2
Const DMBIN_MIDDLE = 3
Const DMBIN_MANUAL = 4
Const DMBIN_ENVELOPE = 5
Const DMBIN_ENVMANUAL = 6
Const DMBIN_AUTO = 7
Const DMBIN_TRACTOR = 8
Const DMBIN_SMALLFMT = 9
Const DMBIN_LARGEFMT = 10
Const DMBIN_LARGECAPACITY = 11
Const DMBIN_CASSETTE = 14
Const DMBIN_FORMSOURCE = 15
Const DMRES_DRAFT = -1
Const DMRES_LOW = -2
Const DMRES_MEDIUM = -3
Const DMRES_HIGH = -4
Const DMCOLOR_MONOCHROME = 1
Const DMCOLOR_COLOR = 2
Const DMDUP_SIMPLEX = 1
Const DMDUP_VERTICAL = 2
Const DMDUP_HORIZONTAL = 3
Const DMTT_BITMAP = 1
Const DMTT_DOWNLOAD = 2
Const DMTT_SUBDEV = 4
Const DMCOLLATE_FALSE = 0
Const DMCOLLATE_TRUE = 1
Const DM_GRAYSCALE = 1
Const DM_INTERLACED = 2
Const DMICMMETHOD_NONE = 1
Const DMICMMETHOD_SYSTEM = 2
Const DMICMMETHOD_DRIVER = 3
Const DMICMMETHOD_DEVICE = 4
Const DMICM_SATURATE = 1
Const DMICM_CONTRAST = 2
Const DMICM_COLORMETRIC = 3
Const DMMEDIA_STANDARD = 1
Const DMMEDIA_GLOSSY = 2
Const DMMEDIA_TRANSPARECNY = 3
Const DMDITHER_NONE = 1
Const DMDITHER_COARSE = 2
Const DMDITHER_FINE = 3
Const DMDITHER_LINEART = 4
Const DMDITHER_GRAYSCALE = 5

Used By

ChangeDisplaySettings, CreateDC, EnumDisplaySettings, JOB_INFO_2, PRINTDLG_TYPE, PRINTER_DEFAULTS, PRINTER_INFO_2

Go back to the Structure listing.
Go back to the Reference section index.


Last Modified: January 21, 2001
This page is copyright © 2001 Paul Kuliniewicz. Copyright Information Revised October 29, 2000
Go back to the Windows API Guide home page.
E-mail: vbapi@vbapi.com Send Encrypted E-Mail
This page is at http://www.vbapi.com/ref/d/devmode.html