各位大侠。。
小弟请教下有关于TDeviceMode类的详细使用。。
谢谢。。

解决方案 »

  1.   

    The DEVMODE data structure contains information about the device initialization and environment of a printer. typedef struct _devicemode {    // dvmd  
        BCHAR  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; 
    #if(WINVER >= 0x0400) 
        DWORD  dmICMMethod;         // Windows 95 only 
        DWORD  dmICMIntent;         // Windows 95 only 
        DWORD  dmMediaType;         // Windows 95 only 
        DWORD  dmDitherType;        // Windows 95 only     DWORD  dmReserved1;         // Windows 95 only 
        DWORD  dmReserved2;         // Windows 95 only 
    #endif /* WINVER >= 0x0400 */ 
    } DEVMODE; 
     
      

  2.   

    MembersdmDeviceNameSpecifies the the "friendly" name of the printer; for example, "PCL/HP LaserJet" in the case of PCL/HP LaserJet? This string is unique among device drivers. Note that this name may be truncated to fit in the dmDeviceName array.dmSpecVersionSpecifies the version number of the initialization data specification on which the structure is based. dmDriverVersionSpecifies the printer driver version number assigned by the printer driver developer. dmSizeSpecifies the size, in bytes, of the DEVMODE structure, not including any private driver-specific data that might follow the structure's public members. You can use this member to determine the number of bytes of public data regardless of the version of the DEVMODE structure being used.dmDriverExtraContains 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. dmFieldsA set of bit flags that specify whether certain members of the DEVMODE structure have been initialized. If a field is initialized, its corresponding bit flag is set, otherwise the bit flag is clear.  A printer driver supports only those DEVMODE structure members that are appropriate for the printer technology. The following bit flags are defined, and are listed here with the corresponding structure members:Value Structure Member
    DM_ORIENTATION dmOrientation
    DM_PAPERSIZE dmPaperSize
    DM_PAPERLENGTH dmPaperLength
    DM_PAPERWIDTH dmPaperWidth
    DM_SCALE dmScale
    DM_COPIES dmCopies
    DM_DEFAULTSOURCE dmDefaultSource
    DM_PRINTQUALITY dmPrintQuality
    DM_COLOR dmColor
    DM_DUPLEX dmDuplex
    DM_YRESOLUTION dmYResolution
    DM_TTOPTION dmTTOption
    DM_COLLATE dmCollate
    DM_FORMNAME dmFormName
    DM_LOGPIXELS dmLogPixels
    DM_BITSPERPEL dmBitsPerPel
    DM_PELSWIDTH dmPelsWidth
    DM_PELSHEIGHT dmPelsHeight
    DM_DISPLAYFLAGS dmDisplayFlags
    DM_DISPLAYFREQUENCY dmDisplayFrequency
    DM_ICMMETHOD Windows 95 only: dmICMMethod
    DM_ICMINTENT Windows 95 only: dmICMIntent
    DM_MEDIATYPE Windows 95 only: dmMediaType
    DM_DITHERTYPE Windows 95 only: dmDitherType
     dmOrientationSelects the orientation of the paper. This member can be either DMORIENT_PORTRAIT (1) or DMORIENT_LANDSCAPE (2). 
      

  3.   

    dmPaperSizeSelects 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: Value Meaning
    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
    DMPAPER_FANFOLD_LGL_GERMAN German Legal Fanfold, 8 1/2- by 13-inches
     dmPaperLengthOverrides 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. dmPaperWidthOverrides the width of the paper specified by the dmPaperSize member.