AdvancedDocumentProperties

  LONG AdvancedDocumentProperties(hWnd, hPrinter, pDeviceName, pDevModeOutput, pDevModeInput)    
  HWND hWnd;    
  HANDLE hPrinter;    
  LPSTR pDeviceName;    
  PDEVMODE pDevModeOutput;    
  PDEVMODE pDevModeInput;    

The AdvancedDocumentProperties function allows an application to configure the Advanced settings of a Printer. This function will call the correct Printer Driver associated with the Printer specified by hPrinter, and the Driver will display a Dialog Box to allow the User to configure the Printer. Although the Driver can display any Printer Configuration it wants, it will not allow configuration of the public DEVMODE structure. This is configured through the DocumentProperties.

Parameters

hWnd

Specifies the Parent Window Handle that the Dialog box should be created with.

hPrinter

Indicates the open Printer handle that this function is to be performed upon. This Handle is obtained with the OpenPrinter API.

pDeviceName

This is a pointer to a null-terminated string specifying the Printer Driver DeviceName that the Driver will use to retrieve the correct configuration information. Note: This value could be retrieved by the Driver given the handle of the Printer with the GetPrinter function. The DeviceName is supplied here as a performance enhancement.

pDevModeOutput

This value is a Pointer to a buffer that will contain the new DEVMODE structure. The size of this buffer is determined by calling the AdvancedDocumentProperties with pDevModeOutput set to NULL.

pDevModeInput

This value is a Pointer to a buffer that contains the DEVMODE structure from which the dialog box is initialized.

Return Value

The return value is TRUE if the function was successful, or FALSE if an error occurred. To obtain extended error information, use the GetLastError function.