|
|
|
SFTPRINTPREVIEWN_STARTPRINTING |
The SFTPRINTPREVIEWN_STARTPRINTING notification code is sent when the user requests printing of the current contents.
Parameters (WM_COMMAND Message)
wParam
The low-order word contains the Print Preview control's control identifier. The high-order word specifies the notification code SFTPRINTPREVIEWN_STARTPRINTING.
lParam
Window handle of the Print Preview control sending the notification.
Comments
The SFTPRINTPREVIEWN_STARTPRINTING notification code is sent when the user requests printing of the current contents.
The user can initiate printing by clicking on the Print button of the built-in tool bar or by accepting the Print dialog presented by the control's PrintDialog function.
The SFTPRINTPREVIEWN_STARTPRINTING notification is used to invoke the Print function to print 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 parent window of the Print Preview control receives the SFTPRINTPREVIEWN_STARTPRINTING notification code through the WM_COMMAND message.
Example
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