
Displays a Print property sheet that enables the user to specify the properties of a particular print job. A Print property sheet has a General page that contains controls similar to the Print dialog box. The property sheet can also have additional application-specific and driver-specific property pages as well as the General page.
Syntax
Parameters
- lppd [in, out]
- LPPRINTDLGEX
A pointer to a PRINTDLGEX structure that contains information used to initialize the property sheet. When PrintDlgEx returns, this structure contains information about the user's selections.
Return Value
HRESULT
If the function succeeds, the return value is S_OK and the dwResultAction member of the PRINTDLGEX structure contains one of the following values.
| Return code/value | Description |
|---|---|
| The user clicked the Apply button and later clicked the Cancel button. This indicates that the user wants to apply the changes made in the property sheet, but does not yet want to print. The PRINTDLGEX structure contains the information specified by the user at the time the Apply button was clicked. |
| The user clicked the Cancel button. The information in the PRINTDLGEX structure is unchanged. |
| The user clicked the Print button. The PRINTDLGEX structure contains the information specified by the user. |
If the function fails, the return value may be one of the following COM error codes. For more information, see Error Handling.
| Return code | Description |
|---|---|
| Insufficient memory. |
| One or more arguments are invalid. |
| Invalid pointer. |
| Invalid handle. |
| Unspecified error. |
Remarks
Note that the values of hDevMode and hDevNames in PRINTDLGEX may change when they are passed into PrintDlgEx. This is because these members are filled on both input and output.
Windows Vista: To switch printer selection, use PrintDlg or PrintDlgEx. The PageSetupDlg for Windows Vista does not contain the Printer button.
If PD_RETURNDC is set but PD_USEDEVMODECOPIESANDCOLLATE flag is not set, the PrintDlg and PrintDlgEx functions return incorrect number of copies. To get the correct number of copies, ensure that the calling application always uses PD_USEDEVMODECOPIESANDCOLLATE with PD_RETURNDC.
For more information, see Print Property Sheet.
Examples
For an example, see Using the Print Property Sheet.
Requirements
Minimum supported client | Windows 2000 Professional |
|---|---|
Minimum supported server | Windows 2000 Server |
Header | Commdlg.h (include Windows.h) |
Library | Comdlg32.lib |
DLL | Comdlg32.dll |
Unicode and ANSI names | PrintDlgExW (Unicode) and PrintDlgExA (ANSI) |
See Also
- Reference
- PrintDlg
- PRINTDLGEX
Conceptual- Common Dialog Box Library
Other Resources- CreatePropertySheetPage
Send comments about this topic to Microsoft
Build date: 6/4/2010
