..msdn Add comment W32 Constants Translate this page
The DocumentProperties function retrieves or modifies printer initialization information or displays a printer-configuration property sheet for the specified printer. |
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
DECLARE INTEGER DocumentProperties IN winspool.drv;
STRING @ pDevModeOutput,;
STRING @ pDevModeInput,;
[in] Handle to the parent window of the printer-configuration property sheet.
[in] Handle to a printer object. Use the OpenPrinter or AddPrinter function to retrieve a printer handle.
[in] Pointer to a null-terminated string that specifies the name of the device for which the printer-configuration property sheet is displayed.
[out] Pointer to a DEVMODE structure that receives the printer configuration data specified by the user.
[in] Pointer to a DEVMODE structure that the operating system uses to initialize the property sheet controls.
[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.
|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.
* DocumentProperties call is configured
* to return the required size for DEVMODE buffer
nDevmodeSize = DocumentProperties(_screen.HWnd, hPrinter,;
cPrinterName, 0, 0, 0)
|Read also Microsoft Help and Support article (former Q102966) Registry Entries for Printing.|
See also: PrintDlg
|Word Index links for the DocumentProperties :|
|Translate this page:|
Visited in last 7 days: 42
|Created: ||2003-02-10 10:33:06|
|Modified: ||2009-09-23 12:17:48|
||User Contributed Notes:
|Tristan Leask | 2005-05-03 06:08:32|
|Can this be used to set the orientation of the paper for printing? The DEVMODE example shows how to change it but this change does not stay with the printer and are lost once the printer is closed. I have looked about and i think this is used with the setprinter call. I don't suppoose you have an example of this at all?|
|A.M. | 2005-05-03 09:25:52|
|Modified DEVMODE structure should be used, for example, with CreateDC call like in "Creating a device context for the specified printer" code sample.|
In my understanding, all FoxPro printing-related functions shield the DEVMODE from any access through API calls.
|Tristan Leask | 2005-05-03 11:24:54|
|Okay. Well i am using a third party control that does not allow me to specify that i want to print using a landscape layout. I was going to try and modify the printers settings so that the printer defaults to landscape. I understand i will still need a modified DEVMODE that i will need to use with setprinter. I don't suppose you have an example of doing this?|
I assume that first you get the printer info using getprintera() (print_info_2) then you should be able to the reference to the devmode which you can then modify and put back into the printer info structure. This can then be used with the setprinter() command. Have no idea how to do this all though <g>!
|A.M. | 2005-05-03 12:02:52|
|I was thinking about extending SetPrinter example. Or it rather should be a separate example showing how to set defaults for a printer. Will probably do soon.|
Meanwhile take a look at some Registry keys:
|Tristan Leask | 2005-05-04 03:43:49|
|Okay thats sounds great, thanks. This link might be of interest for you for the example...|
Copyright © 2001-2018
Before reproducing or distributing any data from this site please ask for an approval from its owner. Unless otherwise specified, this page is for your personal and non-commercial use.
The information on this page is presented AS IS, meaning that you may use it at your own risk.
Microsoft Visual FoxPro
and Windows are trade marks
of Microsoft Corp.
All other trademarks are the property of their respective owners.
Credits: PHP (4.4.9), an HTML-embedded scripting language,
MySQL (5.6.39), the Open Source standard SQL database,
Version 4, freeware HTML Editor of choice. Hosted by Korax Online Inc.