Skip to content

Latest commit

 

History

History
80 lines (55 loc) · 2.76 KB

DocumentProperties.md

File metadata and controls

80 lines (55 loc) · 2.76 KB

Home

Function name : DocumentProperties

Group: Printing and Print Spooler - Library: winspool.drv


The DocumentProperties function retrieves or modifies printer initialization information or displays a printer-configuration property sheet for the specified printer.


Code examples:

Configuring DEVMODE structure for a printer
Printing Image File, programmatically set print page orientation to landscape

Declaration:

LONG DocumentProperties(
  HWND hWnd,               // handle to parent window
  HANDLE hPrinter,         // handle to printer object
  LPTSTR pDeviceName,      // device name
  PDEVMODE pDevModeOutput, // modified device mode
  PDEVMODE pDevModeInput,  // original device mode
  DWORD fMode              // mode options
);  

FoxPro declaration:

DECLARE INTEGER DocumentProperties IN winspool.drv;
	INTEGER   hWnd,;
	INTEGER   hPrinter,;
	STRING    pDeviceName,;
	STRING  @ pDevModeOutput,;
	STRING  @ pDevModeInput,;
	INTEGER   fMode
  

Parameters:

hWnd [in] Handle to the parent window of the printer-configuration property sheet.

hPrinter [in] Handle to a printer object. Use the OpenPrinter or AddPrinter function to retrieve a printer handle.

pDeviceName [in] Pointer to a null-terminated string that specifies the name of the device for which the printer-configuration property sheet is displayed.

pDevModeOutput [out] Pointer to a DEVMODE structure that receives the printer configuration data specified by the user.

pDevModeInput [in] Pointer to a DEVMODE structure that the operating system uses to initialize the property sheet controls.

fMode [in] Specifies the operations the function performs. If this parameter is zero, the DocumentProperties function returns the number of bytes required by the printer driver"s DEVMODE data structure.


Return value:

If the function fails, the return value is less than zero.

If the function displays the property sheet, the return value is either IDOK or IDCANCEL, depending on which button the user selects.

If the fMode parameter is zero, the return value is the size of the buffer required to contain the printer driver initialization data. Note that this buffer can be larger than a DEVMODE structure if the printer driver appends private data to the structure.


Comments:

Read also Microsoft Help and Support article (former Q102966) Registry Entries for Printing.

See also: PrintDlg.