Hide

SftPrintPreview/DLL 2.0 - Print Preview Control for C/C++

Display
Print

PrintDialog Function

The PrintDialog function invokes the Print dialog for printer and page range selection.

C

BOOL SftPrintPreview_PrintDialog(HWND hwnd, HWND hwndDialog, BOOL fCurrPage);

C++

BOOL CSftPrintPreview::PrintDialog(HWND hwndDialog = NULL, BOOL fCurrPage);

Parameters

hwnd

The window handle of the Print Preview control.

hwndDialog

The window handle of the application's main window, which serves as the parent window for the Print dialog. If NULL is specified, the application's main window is determined automatically.

fCurrPage

Set to TRUE to allow selection of the "Current Page" radio button on the Print dialog, false otherwise. The Print dialog on Windows versions before Windows 2000 does not offer a current page radio button.

Returns

The return value is TRUE if the function was successful, FALSE otherwise. If the user cancels the dialog, FALSE is returned.

Comments

The PrintDialog function invokes the Print dialog for printer and page range selection.

Printing does not start automatically when the user accepts the Print dialog. Instead, the SFTPRINTPREVIEWN_STARTPRINTING notification code is sent when the user requests printing of the current contents. If the SFTPRINTPREVIEWN_STARTPRINTING notification is not handled by an application, no printing will occur. The C++ class CSftPrintPreview_View automatically handles this notification.

The NM_SFTPRINTPREVIEW_PRINTERCHANGED_CODE notification code is sent when the current printer or current printer attributes have been modified.

An application can display its own, customized Print dialog using the Windows API functions PrintDlg and PrintDlgEx.

Example

C

SftPrintPreview_PrintDialog(m_hwndPreview, hwndMain);

C++

m_Preview.PrintDialog();

See Also C/C++ API | C++ Classes | Notifications


Last Updated 08/13/2020 - (email)
© 2024 Softel vdm, Inc.