Prev Next

AdvancedDocumentProperties info  Overview  Group

The AdvancedDocumentProperties function displays a printer-configuration dialog box for the specified printer, allowing the user to configure that printer.

LONG AdvancedDocumentProperties(

    HWND hWnd,

// handle to dialog box’s parent window

    HANDLE hPrinter,

// handle to printer object

    LPTSTR pDeviceName,

// pointer to driver name

    PDEVMODE pDevModeOutput,

// pointer to modified device mode structure

    PDEVMODE pDevModeInput 

// pointer to original device mode structure

   );

Parameters

hWnd
Identifies the parent window of the printer-configuration dialog box.
hPrinter
Identifies a printer object.
pDeviceName
Pointer to a null-terminated string specifying the name of the device for which a printer-configuration dialog box should be displayed.
pDevModeOutput
Pointer to a DEVMODE structure that will contain the configuration data specified by the user. An application can retrieve the number of bytes required for this structure by calling the AdvancedDocumentProperties function and setting pDevModeOutput to NULL.
pDevModeInput
Pointer to a DEVMODE structure that contains the configuration data used to initialize the controls of the printer-configuration dialog box.

Return Values

If the function succeeds, the return value is zero.

If the function fails, the return value is nonzero. To get extended error information, call GetLastError.

Remarks

An application can obtain the printer handle identified by the hPrinter parameter by calling the OpenPrinter or AddPrinter function.

An application can obtain the name pointed to by the pDeviceName parameter by calling the GetPrinter function and then examining the pPrinterName member of the PRINTER_INFO_2 structure.

See Also

AddPrinter, DEVMODE, GetPrinter, OpenPrinter, PRINTER_INFO_2