|
|
|
PrintSetupExternal |
The PrintSetupExternal function invokes the Print Setup dialog for printer settings definition.
C
BOOL WINAPI SftPrintPreview_PrintSetupExternal(SFTPRINTPREVIEW_PRINTERRESULT * Prt, BOOL* fDefault, HWND hwndMain);
C++
static BOOL CSftPrintPreview::PrintSetupExternal(SFTPRINTPREVIEW_PRINTERRESULT& Prt, BOOL& fDefault, HWND hwndMain);
Parameters
Prt
The printer definitions.
fDefault
Returns TRUE if the printer is the default printer, FALSE otherwise.
hwndMain
The window handle of the application's main window, which serves as the parent window for the Print Setup dialog. If NULL is specified, the application's main window is determined automatically.
Returns
The return value is TRUE if the function was successful, FALSE otherwise. If the user cancels the dialog, FALSE is returned.
Comments
The PrintSetupExternal function invokes the Print Setup dialog for printer settings definition.
The PrintSetupExternal function is identical to the PrintSetup function, but doesn't require a SftPrintPreview control to be active and returns the defined printer in a SFTPRINTPREVIEW_PRINTERRESULT structure. This allows an application to manipulate the current/selected printer before the first SftPrintPreview control is created.
Example
C
SFTPRINTPREVIEW_PRINTERRESULT Prt; BOOL fDefault; memset(&Prt, 0, sizeof(Prt)); if (SftPrintPreview_PrintSetupExternal(&Prt, &fDefault, hwndMain)) { BOOL fUpdated; double left = 0.1, right = 0.1, top = 0.1, bottom = 0.1, hdr = 0.1, footer = 0.1; if (SftPrintPreview_CheckMarginsPrintableExternal(&Prt, TRUE, &fUpdated, &left, &right, &top, &bottom, &hdr, &footer)) ; // Margins are OK }
C++
SFTPRINTPREVIEW_PRINTERRESULT Prt; BOOL fDefault; memset(&Prt, 0, sizeof(Prt)); if (CSftPrintPreview::PrintSetupExternal(Prt, fDefault, NULL)) { BOOL fUpdated; double left = 0.1, right = 0.1, top = 0.1, bottom = 0.1, hdr = 0.1, footer = 0.1; if (CSftPrintPreview::CheckMarginsPrintableExternal(&Prt, TRUE, &fUpdated, &left, &right, &top, &bottom, &hdr, &footer)) ; // Margins are OK }
See Also C/C++ API | C++ Classes | Notifications