DEVMODE

The Microsoft Windows DEVMODE structures contain information about the device initialization and environment of a printer.

C Syntax
typedef struct _devicemode {
    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 /* WINVER >= 0x0500 */
#endif /* WINVER >= 0x0400 */
} DEVMODE;
Members

dmDeviceName

Specifies the name of the device the driver supports (for example, PCL/HP LaserJet for PCL/HP LaserJet®). This string is unique among device drivers.

dmSpecVersion

Specifies the version number of the initialization data specification on which the structure is based.

dmDriverVersion

Specifies the printer driver version number assigned by the printer driver developer.

dmSize

Specifies the size, in bytes, of the DEVMODE structure except the dmDriverData (device-specific) member. If an application manipulates only the driver-independent portion of the data, it can use this member to determine the length of the structure without having to account for different versions.

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. See Remarks below.

dmFields

Specifies which of the remaining members in the DEVMODE structure have been initialized. Bit 0 (defined as DM_ORIENTATION) corresponds to dmOrientation; bit 1 (defined as DM_PAPERSIZE) specifies dmPaperSize, and so on. A printer driver supports only those members that are appropriate for the printer technology.

dmOrientation

Selects the orientation of the paper. This member can be set to either of the following:

Constant Description


DMORIENT_PORTRAIT



DMORIENT_LANDSCAPE


dmPaperSize

Selects the size of the paper to print on. This member can be set to zero if the length and width of the paper are both set by the dmPaperLength and dmPaperWidth members. Otherwise, the dmPaperSize member can be set to one of the following predefined values:

Constant Description


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


DMPA PER_FANFOLD_
LGL_GERMAN

German Legal Fanfold, 8 1/2 by 13 inches

dmPaperLength

Overrides the length of the paper specified by the dmPaperSize member, either for custom paper sizes or for devices such as dot-matrix printers, which can print on a page of arbitrary length. These values, along with all other values in this structure that specify a physical length, are in tenths of a millimeter.

dmPaperWidth

Overrides the width of the paper specified by the dmPaperSize member.

dmScale

Specifies the factor by which the printed output is to be scaled. The apparent page size is scaled from the physical page size by a factor of dmScale/100. For example, a letter-sized page with a dmScale value of 50 would contain as much data as a page of 17 by 22 inches because the output text and graphics would be half their original height and width.

dmCopies

Selects the number of copies printed if the device supports multiple-page copies.

dmDefaultSource

Reserved. This member must be set to 0.

dmPrintQuality

Specifies the printer resolution. There are four predefined device-independent values. If a positive value is given, it specifies the number of dots per inch (DPI) and is therefore device dependent.

Constant Description


DMRES_HIGH



DMRES_MEDIUM



DMlRES_LOW



DMRES_DRAFT


dmColor

Switches between color and monochrome on color printers. Following are the possible values:

Constant Description


DMCOLOR_COLOR



DMCOLOR_MONOCHROME


dmDuplex

Selects duplex or double-sided printing for printers capable of duplex printing. Following are the possible values:

Constant Description


DMDUP_SIMPLEX



DMDUP_HORIZONTAL



DMDUP_VERTICAL


dmYResolution

Specifies the y-resolution, in dots per inch, of the printer. If the printer initializes this member, the dmPrintQuality member specifies the x-resolution, in dots per inch, of the printer.

dmTTOption

Specifies how TrueType® fonts should be printed. This member can be one of the following values:

Constant Description


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.

dmCollate

Specifies whether collation should be used when printing multiple copies. Using DMCOLLATE_FALSE provides faster, more efficient output, since the data is sent to a page printer just once, no matter how many copies are required. The printer is told to simply print the page again. This member can be be one of the following values:

Constant Description


DMCOLLATE_TRUE

Collate when printing multiple copies.


DMCOLLATE_FALSE

Do NOT collate when printing multiple copies.

dmFormName

Specifies the name of the form to use; for example, Letter or Legal. A complete set of names can be retrieved through the Windows EnumForms function.

dmUnusedPadding

Used to align the structure to a DWORD boundary. This should not be used or referenced. Its name and usage is reserved, and can change in future releases.

dmBitsPerPel

Specifies in bits per pixel the color resolution of the display device. For example: 4 bits for 16 colors, 8 bits for 256 colors, or 16 bits for 65,536 colors.

dmPelsWidth

Specifies the width, in pixels, of the visible device surface.

dmPelsHeight

Specifies the height, in pixels, of the visible device surface.

dmDisplayFlags

Specifies the device's display mode. The following are valid flags:

Constant Description


DM_GRAYSCALE

Specifies that the display is a non-color 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, non-interlaced is assumed.

dmDisplay
Frequency

Specifies the frequency, in hertz (cycles per second), of the display device in a particular mode.

dmICMMethod

Specifies how ICM is handled. For a non-ICM application, this member determines if ICM is enabled or disabled. For ICM applications, the system examines this member to determine how to handle ICM support. 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. This member can be one of the following predefined values, or a driver-defined value greater than or equal to the value of DMICMMETHOD_USER.

Constant Description


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.

dmICMIntent

Windows 95/98, Windows 2000: Specifies which of the three possible color matching methods, or intents, should be used by default. This member is primarily for non-ICM applications. ICM applications can establish intents by using the ICM functions. This member can be one of the following predefined values, or a driver defined value greater than or equal to the value of DMICM_USER.

Constant Description


DMICM_ABS_
COLORIMETRIC

Color matching should optimize to match the exact color requested without white point mapping. This value is most appropriate for use with proofing.


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.


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_SATURATE

Color matching should optimize for color saturation. This value is the most appropriate choice for business graphs when dithering is not desired.

dmMediaType

Windows 95/98, Windows 2000: Specifies the type of media being printed on. The member can be one of the following predefined values, or a driver-defined value greater than or equal to the value of DMMEDIA_USER.

Constant Description


DMMEDIA_STANDARD

Plain paper.


DMMEDIA_GLOSSY

Glossy paper.


DMMEDIA_TRANSPARENCY

Transparent film.

dmDitherType

Windows 95/98, Windows 2000: Specifies how dithering is to be done. The member can be one of the following predefined values, or a driver-defined value greater than or equal to the value of DMDITHER_USER.

Constant Description


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_
ERRORDIFFUSION

Windows 95/98: Dithering in which an algorithm is used to spread, or diffuse, the error of approximating a specified color over adjacent pixels. In contrast, DMDITHER_COARSE, DMDITHER_FINE, and DMDITHER_LINEART use patterned halftoning to approximate a color.


DMDITHER_GRAYSCALE

Device does grayscaling.

dmReserved1

Windows 95/98, Windows 2000: Not used; must be zero.

dmReserved2

Windows 95/98, Windows 2000: Not used; must be zero.

dmPanningWidth

Windows NT/Windows 2000: This member must be zero. Windows 95/98: This member is not supported.

dmPanningHeight

Windows NT/Windows 2000: This member must be zero. Windows 95/98: This member is not supported.

Remarks



Seagate Software IMG Holdings, Inc.
http://www.seagatesoftware.com
Support services:
http://support.seagatesoftware.com