AfxPrinterDialogfunction
Displays the printer dialog. Returns TRUE or FALSE.
Syntax
FUNCTION AfxPrinterDialog (BYVAL hwndOwner AS HWND, BYREF flags AS DWORD, BYREF hdc AS HDC, BYREF nCopies AS WORD, BYREF nFromPage AS WORD, BYREF nToPage AS WORD, BYREF nMinPage AS WORD, BYREF nMaxPage AS WORD) AS BOOLEAN
Parameters
| Name | Description | |
|---|---|---|
hwndOwner | A handle to the window that owns the dialog box. This member can be any valid window handle, or it can be NULL if the dialog box has no owner. | |
flags | Initializes the Print dialog box. When the dialog box returns, it sets these flags to indicate the user's input. See PRINTDLGW structure. | |
hdc | A handle to a device context or an information context, depending on whether the Flags member specifies the PD_RETURNDC or PC_RETURNIC flag. If neither flag is specified, the value of this member is undefined. If both flags are specified, PD_RETURNDC has priority. | |
nCopies | The number of copies. | |
nFromPage | The initial page. | |
nToPage | The final page. | |
nMinPage | The minimum value for the page range specified in the From and To page edit controls. If nMinPage equals nMaxPage, the Pages radio button and the starting and ending page edit controls are disabled. | |
nMaxPage | The maximum value for the page range specified in the From and To page edit controls. |
Return value
Returns TRUE or FALSE. The caller is resposible of deleting the returned HDC handle with DeleteDC.
Description
Displays the printer dialog. Returns TRUE or FALSE.
Example
DIM flags AS DWORD = PD_RETURNDC, hdc AS HDC, nCopies AS WORD DIM nFromPage AS WORD, nToPage AS WORD, nMinPage AS WORD, nMaxPage AS WORD IF AfxPrinterDialog(hwnd, flags, hdc, nCopies, nFromPage, nToPage, nMinPage, nMaxPage) THEN ' // do printing IF hdc THEN DeleteDC hdc END IF
Reference
- Include file
AfxPrinter.inc - Defined in AfxNova/AfxPrinter.inc:117
- Documented in Printing/Printer Functions.md
- Topic: Printer Functions