다음을 통해 공유


DEVMODEW (Windows CE 5.0)

Send Feedback

This structure specifies characteristics of display and print devices.

typedef struct _devicemodew {  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;  WCHAR dmFormName[CCHFORMNAME];  WORD dmLogPixels;  DWORD dmBitsPerPel;  DWORD dmPelsWidth;  DWORD dmPelsHeight;  DWORD dmDisplayFlags;  DWORD dmDisplayFrequency;  DWORD dmDisplayOrientation;} DEVMODEW,* PDEVMODEW,* NPDEVMODEW,* LPDEVMODEW;

Members

  • dmDeviceName
    For a display, the name of the display driver's DLL in quotations; for example, "Ddi_ati.dll".

    For a printer, the friendly name; for example, "PCL/HP LaserJet" in the case of PCL/HP LaserJet.

  • dmSpecVersion
    Reserved.

  • dmDriverVersion
    Reserved.

  • dmSize
    Size in bytes of the public DEVMODEW structure, not including any private, driver-specified members identified by the dmDriverExtra member.

  • dmDriverExtra
    Number of bytes of private driver data that follow the public structure members. If a device driver does not provide private DEVMODEW members, this member should be set to zero.

  • dmFields
    Bit flags identifying which of the following DEVMODEW members are in use. For example, the DM_ORIENTATION flag is set when the dmOrientation member contains valid data. The DM_XXX flags are defined in wingdi.h.

  • dmOrientation
    For printers, the paper orientation. This member can be either DMORIENT_PORTRAIT or DMORIENT_LANDSCAPE.

    This member is not used for displays.

  • dmPaperSize
    For printers, the size of the paper to be printed on. The following table shows the possible values for this member.

    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

    This member is not used for displays.

  • dmPaperLength
    Reserved.

  • dmPaperWidth
    Reserved.

  • dmScale
    Reserved.

  • dmCopies
    For printers, the number of copies to be printed, if the device supports multiple copies.

    This member is not used for displays.

  • dmDefaultSource
    Reserved.

  • dmPrintQuality
    For printers, the printer resolution. The following list shows the negative constant values are defined in wingdi.h:

    • DMRES_HIGH
    • DMRES_MEDIUM
    • DMRES_LOW
    • DMRES_DRAFT

    If a positive value is specified, it represents the number of dots per inch (DPI) for the x resolution, and the y resolution is specified by dmYResolution.

    This member is not used for displays.

  • dmPosition
    For displays, the position on the upper-left corner of the display, in desktop coordinates. This member is used to determine the relative position of monitors in a multiple monitor environment.

    This member is not used for printers.

  • dmColor
    For printers, whether a color printer should print color or monochrome. This member can be one of DMCOLOR_COLOR or DMCOLOR_MONOCHROME.

    This member is not used for displays.

  • dmDuplex
    Reserved.

  • dmYResolution
    Reserved.

  • dmTTOption
    Reserved.

  • dmCollate
    Reserved.

  • dmFormName
    Reserved.

  • dmLogPixels
    Reserved.

  • dmBitsPerPel
    For displays, the color resolution, in bits per pixel, of a display device.

    This member is not used for printers.

  • dmPelsWidth
    For displays, the width, in pixels, of the visible device surface.

    This member is not used for printers.

  • dmPelsHeight
    For displays, the height, in pixels, of the visible device surface.

    This member is not used for printers.

  • dmDisplayFlags
    This member is not used on Windows CE.

  • dmDisplayFrequency
    Reserved.

  • dmDisplayOrientation
    For displays, the orientation at which images should be presented. When the DM_DISPLAYORIENTATION bit is not set in the dmFields member, this member must be set to zero. The following table shows the possible values when the DM_DISPLAYORIENTATION bit is set in the dmFields member.

    Value Description
    DMDO_DEFAULT The current mode's display device orientation is the natural orientation of the device, and should be used as the default.
    DMDO_90 The display device orientation is 90 degrees, measured clockwise, from that of DMDO_DEFAULT.
    DMDO_180 The display device orientation is 180 degrees, measured clockwise, from that of DMDO_DEFAULT.
    DMDO_270 The display device orientation is 270 degrees, measured clockwise, from that of DMDO_DEFAULT.

    This member is not used for printers.

Remarks

For printer drivers, the DEVMODEW structure is used for specifying printer characteristics required by a print document. It is also used for specifying a printer's default characteristics.

Immediately following a DEVMODEW structure's defined members, often referred to as its public members, there can be a set of driver-defined members, often referred to as private DEVMODEW members. The driver supplies the size, in bytes, of this private area in dmDriverExtra. Driver-defined private members are for exclusive use by the driver. The following code example shows the starting address for the private members and how to reference them using the dmSize member.

PVOID pvDriverData = (PVOID) (((BYTE* ) pdm) + (pdm->dmSize));

Requirements

OS Versions: Windows CE 2.12 and later.
Header: Wingdi.h.

See Also

Display Drivers | DrvGetModes

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.