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.
HRESULT WINAPI PrintDlgEx( _Inout_ LPPRINTDLGEX lppd );
lppd [in, out]
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.
This structure must be declared dynamically using a memory allocation function.
If the function succeeds, the return value is S_OK and the dwResultAction member of the PRINTDLGEX structure contains one of the following values.
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.
One or more arguments are invalid.
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. Be sure to free the memory allocated for these members
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.
For an example, see Using the Print Property Sheet.
Minimum supported client
|Windows 2000 Professional [desktop apps only]|
Minimum supported server
|Windows 2000 Server [desktop apps only]|
|Commdlg.h (include Windows.h)|
Unicode and ANSI names
|PrintDlgExW (Unicode) and PrintDlgExA (ANSI)|