DEVNAMES

3.1

#include <commdlg.h>

typedef struct tagDEVNAMES {    /* dn */
    UINT wDriverOffset;
    UINT wDeviceOffset;
    UINT wOutputOffset;
    UINT wDefault;
    /* optional data may appear here  */
} DEVNAMES;

The DEVNAMES structure contains offsets to strings that specify the driver, name, and output port of a printer. The PrintDlg function uses these strings to initialize controls in the system-defined Print dialog box. When the user chooses the OK button to close the dialog box, information about the selected printer is returned in this structure.

Members

wDriverOffset

Specifies the offset from the beginning of the structure to a null-terminated string that specifies the Microsoft MS-DOSÒ filename (without extension) of the device driver. On input, this string is used to set which printer to initially display in the dialog box.

wDeviceOffset

Specifies the offset from the beginning of the structure to the null-terminated string that specifies the name of the device. This string cannot exceed 32 bytes in length, including the null character, and must be identical to the dmDeviceName member of the DEVMODE structure.

wOutputOffset

Specifies the offset from the beginning of the structure to the null-terminated string that specifies the MS-DOS device name for the physical output medium (output port).

wDefault

Specifies whether the strings specified in the DEVNAMES structure identify the default printer. It is used to verify that the default printer has not changed since the last print operation. On input, this member can be set to DN_DEFAULTPRN. If the DN_DEFAULTPRN flag is set, the other values in the DEVNAMES structure are checked against the current default printer.

On output, the wDefault member is changed only if the Print Setup dialog box was displayed and the user chose the OK button to close it. If the default printer was selected, the DN_DEFAULTPRN flag is set. If a printer is specifically selected, the flag is not set. All other bits in this member are reserved for internal use by the dialog box procedure of the Print dialog box.

See Also

PrintDlg