Структура DEVMODE

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
  dmUnusedPadding 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
  ' только для Windows 95, 98, 2000
  dmICMMethod As Long
  dmICMIntent As Long
  dmMediaType As Long
  dmDitherType As Long
  dmReserved1 As Long
  dmReserved2 As Long
  ' только для Windows 2000
  dmPanningWidth As Long
  dmPanningHeight As Long
End Type

Структура DEVMODE содержит информацию о различных настройках и свойствах устройств. В основном, эта информация касается принтера. Но часть элементов структуры используется для других устройств, например, для настройки свойств экрана.

Состав структуры

dmDeviceName
Имя устройства
dmSpecVersion
Номер версии спецификации для устройства
dmDriverVersion
Номер версии драйвера устройства
dmSize
Размер структуры в байтах
dmDriverExtra
The number of bytes of information trailing the structure in memory.
dmFields
Комбинация флагов, определяющих which of the rest of the structure's members contain information about the device:
DM_ORIENTATION= &H1
dmOrientation содержит информацию
DM_PAPERSIZE= &H2
dmPaperSize содержит информацию
DM_PAPERLENGTH= &H4
dmPaperLength содержит информацию
DM_PAPERWIDTH= &H8
dmPaperWidth содержит информацию
DM_SCALE= &H10
dmScale содержит информацию
DM_COPIES= &H100
dmCopies содержит информацию
DM_DEFAULTSOURCE= &H200
dmDefaultSource содержит информацию
DM_PRINTQUALITY= &H400
dmPrintQuality содержит информацию
DM_COLOR= &H800
dmColor содержит информацию
DM_DUPLEX= &H1000
dmDuplex содержит информацию
DM_YRESOLUTION= &H2000
dmYResolution содержит информацию
DM_TTOPTION= &H4000
dmTTOption содержит информацию
DM_COLLATE= &H8000
dmCollate содержит информацию
DM_FORMNAME= &H10000
dmFormName содержит информацию
DM_LOGPIXELS= &H20000
dmLogPixels содержит информацию
DM_BITSPERPEL= &H40000
Глубина цвета (бит на пиксел)
DM_PELSWIDTH= &H80000
Размер по горизонтали в пикселах
DM_PELSHEIGHT= &H100000
Размер по вертикали в пикселах
DM_DISPLAYFLAGS= &H200000
dmDisplayFlags contains information.
DM_DISPLAYFREQUENCY= &H400000
dmDisplayFrequency contains information.
DM_ICMMETHOD= &H800000
Win 95/98 only: dmICMMethod содержит информацию
DM_ICMINTENT= &H1000000
Windows 95, 98, 2000: dmICMIntent содержит информацию
DM_MEDIATYPE= &H2000000
Windows 95, 98, 2000: dmMediaType содержит информацию
DM_DITHERTYPE= &H4000000
Windows 95, 98, 2000: dmDitherType содержит информацию
DM_PANNINGWIDTH= &H20000000
Windows 2000: dmPanningWidth содержит информацию
DM_PANNINGHEIGHT= &H40000000
Windows 2000: dmPanningHeight содержит информацию
dmOrientation
One of the following flags specifying the orientation of the printer paper:
DMORIENT_PORTRAIT= 1
Portrait (tall) mode.
DMORIENT_LANDSCAPE= 2
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= 1
Letter, 8.5 x 11 inches.
DMPAPER_LEGAL= 5
Legal, 8.5 x 14 inches.
DMPAPER_10X11= 45
10 x 11 inches.
DMPAPER_10X14= 16
10 x 14 inches.
DMPAPER_11X17= 17
11 x 17 inches.
DMPAPER_15X11= 46
15 x 11 inches.
DMPAPER_9X11= 44
9 x 11 inches.
DMPAPER_A_PLUS= 57
A plus sheet.
DMPAPER_A2= 66
A2 sheet.
DMPAPER_A3= 8
A3 sheet, 297 x 420 millimeters.
DMPAPER_A3_EXTRA= 63
A3 extra sheet.
DMPAPER_A3_EXTRA_TRANSVERSE= 68
A3 extra transverse sheet.
DMPAPER_A3_TRANSVERSE= 67
A3 transverse sheet.
DMPAPER_A4= 9
A4 sheet, 210 x 297 millimeters.
DMPAPER_A4_EXTRA= 53
A4 extra sheet.
DMPAPER_A4_PLUS= 60
A4 plus sheet.
DMPAPER_A4_TRANSVERSE= 55
A4 transverse sheet.
DMPAPER_A4SMALL= 10
A4 small sheet, 210 x 297 millimeters.
DMPAPER_A5= 11
A5 sheet, 148 x 210 millimeters.
DMPAPER_A5_EXTRA= 64
A5 extra sheet.
DMPAPER_A5_TRANSVERSE= 61
A5 transverse sheet.
DMPAPER_B_PLUS= 58
B plus sheet.
DMPAPER_B4= 12
B4 sheet, 250 x 354 millimeters.
DMPAPER_B5= 13
B5 sheet, 192 x 257 millimeters.
DMPAPER_B5_EXTRA= 65
B5 extra sheet.
DMPAPER_B5_TRANSVERSE= 62
B5 transverse sheet.
DMPAPER_CSHEET= 24
C sheet, 17 x 22 inches.
DMPAPER_DSHEET= 25
D sheet, 22 x 34 inches.
DMPAPER_ENV_10= 20
#10 envelope, 4.125 x 9.5 inches.
DMPAPER_ENV_11= 21
#11 envelope, 4.5 x 10.375 inches.
DMPAPER_ENV_12= 22
#12 envelope, 4.75 x 11 inches.
DMPAPER_ENV_14= 23
#14 envelope, 5 x 11.5 inches.
DMPAPER_ENV_9= 19
#9 envelope, 3.875 x 8.875 inches.
DMPAPER_ENV_B4= 33
B4 envelope, 250 x 353 millimeters.
DMPAPER_ENV_B5= 34
B5 envelope, 176 x 250 millimeters.
DMPAPER_ENV_B6= 35
B6 envelope, 176 x 125 millimeters.
DMPAPER_ENV_C3= 29
C3 envelope, 324 x 458 millimeters.
DMPAPER_ENV_C4= 30
C4 envelope, 229 x 324 millimeters.
DMPAPER_ENV_C5= 28
C5 envelope, 162 x 229 millimeters.
DMPAPER_ENV_C6= 31
C6 envelope, 114 x 162 millimeters.
DMPAPER_ENV_C65= 32
C65 envelope, 114 x 229 millimeters.
DMPAPER_ENV_DL= 27
DL envelope, 110 x 220 millimeters.
DMPAPER_ENV_INVITE= 47
Invitation envelope.
DMPAPER_ENV_ITALY= 36
Italy envelope, 110 x 230 millimeters.
DMPAPER_ENV_MONARCH= 37
Monarch envelope, 3.875 x 7.5 inches.
DMPAPER_ENV_PERSONAL= 38
Personal (6.75) envelope, 3.625 x 6.5 inches.
DMPAPER_ESHEET= 26
E sheet, 34 x 44 inches.
DMPAPER_EXECUTIVE= 7
Executive, 7.25 x 10.5 inches.
DMPAPER_FANFOLD_LGL_GERMAN= 41
German legal fanfold, 8.5 x 13 inches.
DMPAPER_FANFOLD_STD_GERMAN= 40
German standard fanfold, 8.5 x 12 inches.
DMPAPER_FANFOLD_US= 39
US standard fanfold, 14.875 x 11 inches.
DMPAPER_FIRST= 1
Same as DMPAPER_LETTER.
DMPAPER_FOLIO= 14
Folio, 8.5 x 13 inches.
DMPAPER_ISO_B4= 42
ISO B4 sheet.
DMPAPER_JAPANESE_POSTCARD= 43
Japanese postcard.
DMPAPER_LAST= 41
Same as DMPAPER_FANFOLD_LGL_GERMAN.
DMPAPER_LEDGER= 4
Ledger, 17 x 11 inches.
DMPAPER_LEGAL_EXTRA= 51
Legal extra.
DMPAPER_LETTER_EXTRA= 50
Letter extra.
DMPAPER_LETTER_EXTRA_TRANSVERSE= 56
Letter extra transverse.
DMPAPER_LETTER_PLUS= 59
Letter plus.
DMPAPER_LETTER_TRANSVERSE= 54
Letter transverse.
DMPAPER_LETTERSMALL= 2
Letter small, 8.5 x 11 inches.
DMPAPER_NOTE18
Note, 8.5 x 11 inches.
DMPAPER_QUARTO= 15
Quarto, 215 x 275 millimeters.
DMPAPER_STATEMENT= 6
Statement, 5.5 x 8.5 inches.
DMPAPER_TABLOID= 3
Tabloid, 11 x 17 inches.
DMPAPER_TABLOID_EXTRA= 52
Tabloid extra.
DMPAPER_USER= 256
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= 1
There is only one paper source.
DMBIN_UPPER= 1
Upper bin.
DMBIN_LOWER= 2
Lower bin.
DMBIN_MIDDLE= 3
Middle bin.
DMBIN_MANUAL= 4
Manual loading.
DMBIN_ENVELOPE= 5
Envelope bin.
DMBIN_ENVMANUAL= 6
Manual-loading envelope.
DMBIN_AUTO= 7
Automatic loading.
DMBIN_TRACTOR= 8
Tractor loading.
DMBIN_SMALLFMT= 9
Small format loading.
DMBIN_LARGEFMT= 10
Large format loading.
DMBIN_LARGECAPACITY= 11
Large-capacity bin.
DMBIN_CASSETTE14
Cassette.
DMBIN_FORMSOURCE= 15
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= -1
Draft-quality output.
DMRES_LOW= -2
Low-quality output.
DMRES_MEDIUM= -3
Medium-quality output.
DMRES_HIGH= -4
High-quality output.
dmColor
One of the following flags specifying whether the device supports color:
DMCOLOR_MONOCHROME= 1
The device does not support color output.
DMCOLOR_COLOR= 2
The device supports color output.
dmDuplex
One of the following flags specifying the printer's double-sided (duplex) printing capability:
DMDUP_SIMPLEX= 1
Configured for single-sided printing.
DMDUP_VERTICAL= 2
Configured for double-sided printing with vertical page turning.
DMDUP_HORIZONTAL= 3
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= 1
The printer prints TrueType fonts as graphics (default for dot-matrix printers).
DMTT_DOWNLOAD= 2
The printer downloads TrueType fonts as soft fonts (default for Hewlett-Packerd printers using Printer Control Language).
DMTT_SUBDEV= 4
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= 0
Does not collate pages when printing multiple copies.
DMCOLLATE_TRUE= 1
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= 1
The display does not support color. (If this flag is omitted, assume color is supported.)
DM_INTERLACED= 2
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= 1
ICM is disabled.
DMICMMETHOD_SYSTEM= 2
ICM is handled by Windows.
DMICMMETHOD_DRIVER= 3
ICM is handled by the device driver.
DMICMMETHOD_DEVICE= 4
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= 1
Color matching attempts to optimize color saturation.
DMICM_CONTRAST= 2
Color matching attempts to optimize color contrast.
DMICM_COLORMETRIC= 3
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= 1
Plain paper.
DMMEDIA_GLOSSY= 2
Glossy paper.
DMMEDIA_TRANSPARECNY= 3
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= 1
No dithering.
DMDITHER_COARSE= 2
Dithering with a coarse brush.
DMDITHER_FINE= 3
Dithering with a fine brush.
DMDITHER_LINEART= 4
Line art dithering, which makes well-defined borders between black, white, and gray.
DMDITHER_GRAYSCALE= 5
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.

Используется в

CreateDC, EnumDisplaySettings, JOB_INFO_2, PRINTDLG_TYPE, PRINTER_DEFAULTS, PRINTER_INFO_2