|
|
|
NM_SFTPRINTPREVIEW_RETURN_CODE |
The NM_SFTPRINTPREVIEW_RETURN_CODE notification code is sent when the user presses the Return key while the Print Preview control has the input focus.
NM_SFTPRINTPREVIEW_RETURN* pNtfy = (NM_SFTPRINTPREVIEW_RETURN*) lParam;
Parameters (WM_NOTIFY Message)
wParam
Contains the Print Preview control's control identifier.
lParam
Pointer to an NM_SFTPRINTPREVIEW_RETURN structure that contains information specific to this notification. The structure also contains a standard NMHDR structure, which has additional information about the control sending this notification.
Return Value
The return value is ignored.
Comments
The NM_SFTPRINTPREVIEW_RETURN_CODE notification code is sent when the user presses the Return key while the Print Preview control has the input focus.
If the input focus is on a combo box or edit control located on the built-in tool bar, this notification does not occur.
This notification is intended for environments where the control is located on a dialog. Default button handling is disabled while the Print preview control has the input focus. The NM_SFTPRINTPREVIEW_RETURN_CODE notification code can be used to take an appropriate action if the user hits the Return key.
The parent window of the Print Preview control receives the NM_SFTPRINTPREVIEW_RETURN_CODE notification code through the WM_NOTIFY message.
Example
C
LRESULT CALLBACK MainWindowProc(HWND hwndMain, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch (uMsg) { case WM_NOTIFY: { int id = (int) wParam; LPNMHDR pnmh = (LPNMHDR) lParam; switch (id) { case IDC_PREVIEW: switch (pnmh->code) { case NM_SFTPRINTPREVIEW_RETURN_CODE: // The user hit the Return key break; } break; } break; } } return DefWindowProc(hwndMain, uMsg, wParam, lParam); }
C++
BEGIN_MESSAGE_MAP(CPreviewDialog, CDialog) ON_NM_SFTPRINTPREVIEW_RETURN_CODE(IDC_PREVIEW, OnPreviewReturnKey) END_MESSAGE_MAP()
afx_msg void CPreviewDialog::OnPreviewReturnKey(NMHDR* pnmh, LRESULT* result) { NM_SFTPRINTPREVIEW_RETURN* pNotifyStruct = (NM_SFTPRINTPREVIEW_RETURN*) pnmh; // The user hit the Return key }
See Also C/C++ API | C++ Classes | Notifications