Hide

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

Display
Print

NM_SFTPRINTPREVIEW_PAGESETUP_CODE Notification Code

The NM_SFTPRINTPREVIEW_PAGESETUP_CODE notification code is sent when the user requests the Page Setup dialog.

NM_SFTPRINTPREVIEW_PAGESETUP* pNtfy = (NM_SFTPRINTPREVIEW_PAGESETUP*) lParam;

Parameters (WM_NOTIFY Message)

wParam

Contains the Print Preview control's control identifier.

lParam

Pointer to an NM_SFTPRINTPREVIEW_PAGESETUP 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_PAGESETUP_CODE notification code is sent when the user requests the Page Setup dialog.

The NM_SFTPRINTPREVIEW_PAGESETUP_CODE notification is used to invoke the Page Setup dialog to modify the print layout (margins, headers, etc.). If the NM_SFTPRINTPREVIEW_PAGESETUP_CODE notification is not handled by an application, the Page Setup dialog is not accessible. The C++ class CSftPrintPreview_View automatically handles this notification.

The Print Preview control offers a built-in Page Setup dialog, accessible using the PageSetup function. An application can also implement its own Page Setup dialog, which may offer additional features, specific to the application.

The parent window of the Print Preview control receives the NM_SFTPRINTPREVIEW_PAGESETUP_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_PAGESETUP_CODE:
                    SftPrintPreview_PageSetup(m_hwndPreview, hwndMain);
                    break;
                }
                break;
            }
            break;
        }
    }
    return DefWindowProc(hwndMain, uMsg, wParam, lParam);
}

C++

BEGIN_MESSAGE_MAP(CPreviewDialog, CDialog)
    ON_NM_SFTPRINTPREVIEW_PAGESETUP_CODE(IDC_PREVIEW, OnPreviewPageSetup)
END_MESSAGE_MAP()

afx_msg void CPreviewDialog::OnPreviewPageSetup(NMHDR* pnmh, LRESULT* result)
{
    NM_SFTPRINTPREVIEW_PAGESETUP* pNotifyStruct = (NM_SFTPRINTPREVIEW_PAGESETUP*) pnmh;
    SftPrintPreview_PageSetup(m_Preview, m_hWnd);
}

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


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