PRINTDLG_TYPE Structure

Type PRINTDLG_TYPE
  lStructSize As Long
  hwndOwner As Long
  hDevMode As Long
  hDevNames As Long
  hdc As Long
  flags As Long
  nFromPage As Integer
  nToPage As Integer
  nMinPage As Integer
  nMaxPage As Integer
  nCopies As Integer
  hInstance As Long
  lCustData As Long
  lpfnPrintHook As Long
  lpfnSetupHook As Long
  lpPrintTemplateName As String
  lpSetupTemplateName As String
  hPrintTemplate As Long
  hSetupTemplate As Long
End Type

PRINTDLG_TYPE-type variables store the necessary information to use a Print common dialog box or a Print Setup common dialog box. This structure holds all information necessary to initialize the box and receives the data selected by the user. Set the various members for the box's default selections -- they will be set by the called function to the selections of the user. Note that two other structures, DEVMODE and DEVNAMES, are included by specifying handles to a memory block. These memory blocks contain a copy of each structure's data. See the example for PrintDlg for information on how to create, use, and free these memory blocks.

lStructSize
The size in bytes of this structure.
hwndOwner
A handle to the window opening the dialog box, if any.
hDevMode
A handle to the memory block holding the information contained in a DEVMODE structure. This data specifies information about the printer.
hDevNames
A handle to the memory block holding the information contained in a DEVNAMES structure. This data specifies the driver name, printer name, and port name(s) of the printer.
hdc
Receives either a device context or an information context (depending on the value set as flags) to the printer the user selected.
flags
Zero or more of the following flags specifying various options for creating the Print or Print Setup dialog. Note that when PrintDlg returns, many of these flags will be set by the function to indicate selections by the user:
PD_ALLPAGES = &H0
Select the All Pages radio button.
PD_COLLATE = &H10
Check the Collate check box. If this flag is set when the function returns, the user checked the box and the printer doesn't automatically support collation. If the box is checked and the printer does support it, this flag will not be set.
PD_DISABLEPRINTTOFILE = &H80000
Disable the Print to File check box.
PD_ENABLEPRINTHOOK = &H1000
Use the hook function pointed to by lpfnPrintHook to process the Print dialog box's messages.
PD_ENABLEPRINTTEMPLATE = &H4000
Use the Print dialog box template specified by lpPrintTemplateName.
PD_ENABLEPRINTTEMPLATEHANDLE = &H10000
Use the preloaded Print dialog box template specified by hPrintTemplate.
PD_ENABLESETUPHOOK = &H2000
Use the hook function pointed to by lpfnSetupHook to process the Print Setup dialog box's messages.
PD_ENABLESETUPTEMPLATE = &H8000
Use the Print Setup dialog box template specified by lpSetupTemplateName.
PD_ENABLESETUPTEMPLATEHANDLE = &H20000
Use the preloaded Print Setup dialog box template specified by hSetupTemplate.
PD_HIDEPRINTTOFILE = &H100000
Hide the Print to File check box.
PD_NONETWORKBUTTON = &H200000
Do not display any buttons associated with the network.
PD_NOPAGENUMS = &H8
Disable the Page Range radio button and edit boxes.
PD_NOSELECTION = &H4
Disable the Selection radio button.
PD_NOWARNING = &H80
Do not warn the user if there is no default printer.
PD_PAGENUMS = &H2
Select the Page Range radio button.
PD_PRINTSETUP = &H40
Display the Print Setup dialog box instead of the Print dialog box.
PD_PRINTTOFILE = &H20
Select the Print to File check box.
PD_RETURNDC = &H100
Return a device context to the selected printer as hdc.
PD_RETURNDEFAULT = &H400
Instead of displaying either dialog box, simply load information about the default printer into hDevMode and hDevNames. For this to work, those two values must be set to 0 before calling the function.
PD_RETURNIC = &H200
Return an information context to the selected printer as hdc.
PD_SELECTION = &H1
Select the Selection radio button.
PD_SHOWHELP = &H800
Display the Help button.
PD_USEDEVMODECOPIES = &H40000
Same as PD_USEDEVMODECOPIESANDCOLLATE.
PD_USEDEVMODECOPIESANDCOLLATE = &H40000
If the printer does not automatically support multiple copies or collation, disable the corresponding options in the dialog box. The number of copies to print and the collation setting will be placed into hDevMode. The information returned to this structure will specify the number of pages and the collation which the program must print with -- the printer will print the copies or collate itself.
nFromPage
The value entered in the From Page text box, specifying which page begin printing at.
nToPage
The value entered in the To Page text box, specifying which page to stop printing at.
nMinPage
The minimum allowable value for nFromPage and nToPage.
nMaxPage
The maximum allowable value for nFromPage and nToPage.
nCopies
The number of copies the program needs to print.
hInstance
A handle to the application instance which has the desired dialog box template.
lCustData
A program-defined value to pass to whichever hook function is used.
lpfnPrintHook
A handle to the program-defined hook function to use to process the Print dialog box's messages.
lpfnSetupHook
A handle to the program-defined hook function to use to process the Print Setup dialog box's messages.
lpPrintTemplateName
The name of the Print dialog box template to use from the application instance specified by hInstance.
lpSetupTemplateName
The name of the Print Setup dialog box template to use from the application instance specified by hInstance.
hPrintTemplate
A handle to the preloaded Print dialog box template to use.
hSetupTemplate
A handle to the preloaded Print Setup dialog box template to use.

Used by: PrintDlg

Go back to the alphabetical Structure listing.
Go back to the Reference section index.


This page is copyright © 2000 Paul Kuliniewicz. Copyright Information.
Go back to the Windows API Guide home page.
E-mail: vbapi@vbapi.com Send Encrypted E-Mail
This page is at http://www.vbapi.com/ref/p/printdlg_type.html