DEVMODE (Windows CE 5.0)

Windows CE 5.0
Send Feedback

This structure contains information about a printer environment and device initialization.

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 dmDeviceName array.

dmSpecVersion
Unsupported; set to zero.
dmDriverVersion
Unsupported; set to zero.
dmSize
WORD that specifies the size, in bytes, of the DEVMODE structure, 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 DEVMODE structure 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
DWORD that specifies whether certain members of the DEVMODE structure 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 DEVMODE structure that are appropriate for the printer technology.

The following table shows the possible values.

ValueDescription
DM_ORIENTATIONThe dmOrientation member is initialized.
DM_PAPERSIZEThe dmPaperSize member is initialized.
DM_COPIESThe dmCopies member is initialized.
DM_PRINTQUALITYThe dmPrintQuality member is initialized.
DM_COLORThe dmColor member is initialized.
DM_BITSPERPELThe dmBitsPerPel member is initialized.
DM_PELSWIDTHThe dmPelsWidth member is initialized.
DM_PELSHEIGHTThe dmPelsHeight member is initialized.
DM_DISPLAYORIENTATIONThe ChangeDisplaySetttingsEx function should set or obtain the current screen orientation in the dmDisplayOrientation member.
DM_DISPLAYQUERYORIENTATIONThe ChangeDisplaySetttingsEx function 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.

ValueDescription
DMORIENT_LANDSCAPEPrints in landscape orientation.
DMORIENT_PORTRAITPrints in portrait orientation.
dmPaperSize
Short integer that specifies the size of the paper for printer devices.

This following table shows the possible predefined values.

ValueDescription
DMPAPER_A4A4 sheet, 210 millimeters by 297 millimeters
DMPAPER_B4B4 sheet, 250 millimeters by 354 millimeters
DMPAPER_B5B5 sheet, 182 millimeters by 257 millimeters
DMPAPER_LEGALLegal, 8 1/2 inches by 14 inches
DMPAPER_LETTERLetter, 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.

ValueDescription
DMRES_DRAFTDraft quality
DMRES_HIGHHigh quality
dmColor
Short integer that specifies color or monochrome printing on color printers.

The following table shows the possible values.

ValueDescription
DMCOLOR_COLORColor printing
DMCOLOR_MONOCHROMEMonochrome 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
DWORD that 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
DWORD that specifies the width, in pixels, of the visible device surface.

Display drivers use this member, but printer drivers do not.

dmPelsHeight
DWORD that 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
DWORD that specifies the orientation of the screen.

The following table shows the possible values.

ValueDescription
DMDO_0The screen is rotated by 0 degrees.
DMDO_90The screen is rotated by 90 degrees counterclockwise.
DMDO_180The screen is rotated by 180 degrees.
DMDO_270The screen is rotated by 270 degrees counterclockwise.

Remarks

The private data for a device driver follows the public portion of the DEVMODE structure.

The size of the public data can vary for different versions of the structure.

The dmSize member specifies the number of bytes of public data.

You should initialize all unsupported members with a value of zero.

Requirements

OS Versions: Windows CE 2.0 and later.
Header: Windows.h.

See Also

ChangeDisplaySettingsEx | CreateDC | GDI Structures


Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.


Show: