Group: Common Dialog Box - Library: comdlg32
The PageSetupDlg function creates a Page Setup dialog box that enables the user to specify the attributes of a printed page.
Opening the Page Setup dialog box to specify the attributes of a printed page
BOOL PageSetupDlg(
LPPAGESETUPDLG lppsd // initialization data
);
DECLARE INTEGER PageSetupDlg IN comdlg32;
STRING @lppsd
lppsd [in/out] Pointer to a PAGESETUPDLG structure that contains information used to initialize the dialog box.
If the user clicks the OK button, the return value is nonzero. The members of the PAGESETUPDLG structure pointed to by the lppsd parameter indicate the user"s selections.
If the user cancels or closes the Page Setup dialog box or an error occurs, the return value is zero. To get extended error information, use the CommDlgExtendedError function.
The PSD_RETURNDEFAULT flag allows to retrieve the printer page parameters for the default printer (including its name) without displaying the dialog box.