SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftMask/OCX 7.0 - Masked Edit Control
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftPrintPreview/DLL 2.0 - Print Preview Control (discontinued)
SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftDirectory 3.5 - File/Folder Control (discontinued)
SftMask/OCX 7.0 - Masked Edit Control
SftOptions 1.0 - Registry/INI Control (discontinued)
SftPrintPreview/OCX 1.0 - Print Preview Control (discontinued)
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftTabs/NET 6.0 - Tab Control (discontinued)
SftTree/NET 2.0 - Tree Control
The Print function prints the contents.
C
BOOL SftPrintPreview_Print(HWND hwnd, HWND hwndMainWindow);
C++
BOOL CSftPrintPreview::Print(HWND hwndMainWindow = NULL);
hwnd
The window handle of the Print Preview control.
hwndMainWindow
The window handle of the application's main window, which serves as the parent window for the print progress dialog. If NULL is specified, the application's main window is determined automatically.
The return value is TRUE if the function was successful, FALSE otherwise. If the user cancels printing, FALSE is returned.
The Print function prints the contents.
The range of pages to be printed is defined using the SFTPRINTPREVIEW_CONTROL structure member iPrintPages. If the Print dialog (see Print Dialog function) precedes the Print function, the page range entered by the user was automatically saved in the SFTPRINTPREVIEW_CONTROL structure and is used.
While printing is in progress, a modeless dialog is shown informing the user that printing is in progress, along with the current page count. This dialog allows the end-user to cancel printing. This dialog can be enabled or suppressed using the SFTPRINTPREVIEW_CONTROL structure (fWantCancelDialog).
If printing fails, the Print function automatically displays an error message with additional information. This message can be enabled or suppressed using the SFTPRINTPREVIEW_CONTROL structure (fShowErrorMessage).
If printing fails, additional error information is available by retrieving the SFTPRINTPREVIEW_CONTROL structure (fPrintUserAbort, fPrintAppShutDown, fPrintPageOutOfRange, dwdPrintLastError, szPrintLastFunc).
C
LRESULT CALLBACK MainWindowProc(HWND hwndMain, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch (uMsg) { case WM_COMMAND: { HWND hwndCtl = (HWND) lParam; int id = LOWORD(wParam); int code = HIWORD(wParam); if (hwndCtl) { switch (id) { case IDC_PREVIEW: switch (code) { case SFTPRINTPREVIEWN_STARTPRINTING: SftPrintPreview_Print(hwndCtl, hwndMain); break; } break; } } break; } } return DefWindowProc(hwndMain, uMsg, wParam, lParam); }
C++
BEGIN_MESSAGE_MAP(CPreviewDialog, CDialog) ON_SFTPRINTPREVIEWN_STARTPRINTING(IDC_PREVIEW, OnStartPrinting) END_MESSAGE_MAP() afx_msg void CPreviewDialog::OnStartPrinting() { SftPrintPreview_Print(m_Preview, m_hWnd); }
See Also C/C++ API | C++ Classes | Notifications