hPrinter = WinXPrint_Start (minPage, maxPage, @rangeMin, @rangeMax, @cxPhys, @cyPhys, fileName$, showDialog, hWndOwner)
Begins a printing cycle, optionally displaying a print settings dialog box first.
Parameter | Description |
---|---|
minPage | The minimum page the user can select |
maxPage | The maximum page the user can select, if this is the same as minPage the user cannot specify a range of pages |
@rangeMin | The initial first page in the page range. If it is 0 then the selection radio button on the dialog box is enabled and set, otherwise the selection radio button is disabled. When the function returns this parameter is changed to reflect the user's settings |
@rangeMax | The initial last page in the page range. If it is 0 then the all pages radio button is selected. When the function returns this parameter is changed to reflect the user's settings |
@cxPhys | The physical width of the page in device units |
@cyPhys | The physical height of the page in device units |
fileName$ | The name of the print job. Usually you will set this to the name of the file being printed |
showDialog | $$TRUE to display a print settings dialog or $$FALSE to use defaults |
hWndOwner | If the showDialog parameter is $$TRUE, this is the handle to the owner window for the print settings dialog box. If the showDialog parameter is $$FALSE this parameter is ignored. |
The handle to the printer DC or 0 on fail
If the showDialog parameter is $$FALSE the minPage, maxPage, rangeMin and rangeMax parameters are ignored.
When this function returns, the cxPhys and cyPhys parameters will contain the size of the page in printer units (which vary according to the page size and dpi). If cxPhys < cyPhys then page is portrait otherwise it is landscape. You can use these parameters to determine how many printer units you need to use for the WinXPrint_Page function.
'print the contents of a window on a single page |