AdvancedDocumentProperties

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
Handle to the parent window of the printer-configuration dialog box.
hPrinter
Handle to 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.

QuickInfo

  Windows NT: Requires version 3.1 or later.
  Windows: Requires Windows 95 or later.
  Windows CE: Unsupported.
  Header: Declared in winspool.h.
  Import Library: Use winspool.lib.
  Unicode: Implemented as Unicode and ANSI versions on Windows NT.

See Also

Printing and Print Spooler Overview, Printing and Print Spooler Functions, AddPrinter, DEVMODE, GetPrinter, OpenPrinter, PRINTER_INFO_2