Hide

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

Display
Print

NM_SFTPRINTPREVIEW_CLOSE Structure

The NM_SFTPRINTPREVIEW_CLOSE structure describes the NM_SFTPRINTPREVIEW_CLOSE_CODE notification.

typedef struct {
    NMHDR hdr;
    BOOL fButton;
} NM_SFTPRINTPREVIEW_CLOSE;

Members

hdr

Standard NMHDR structure that contains information about this notification.

fButton

Set to TRUE if the Close button on the built-in tool bar was pressed, otherwise set to FALSE (the user hit the Escape key)

Comments

The NM_SFTPRINTPREVIEW_CLOSE structure describes the NM_SFTPRINTPREVIEW_CLOSE_CODE notification.

The NM_SFTPRINTPREVIEW_CLOSE_CODE notification code is sent when the users requests to close the Print Preview control window.

General information about the control sending this notification is contained in the hdr structure (see NMHDR).

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_CLOSE_CODE: { // user wants to close
                            NM_SFTPRINTPREVIEW_CLOSE* pNtfy = (NM_SFTPRINTPREVIEW_CLOSE*) lParam;
                            SendMessage(hwndMain, WM_CLOSE, 0, 0);
                            break;
                        }
                    }
                    break;
            }
            break;
        }
    }
    return DefWindowProc(hwndMain, uMsg, wParam, lParam);
}

C++

afx_msg void OnPreviewClose(NMHDR* pnmh, LRESULT* result);

BEGIN_MESSAGE_MAP(CPreviewDialog, CDialog)
    ON_NM_SFTPRINTPREVIEW_CLOSE_CODE(IDC_PREVIEW, OnPreviewClose)
END_MESSAGE_MAP()

afx_msg void CPreviewDialog::OnPreviewClose(NMHDR* pnmh, LRESULT* result)
{
    NM_SFTPRINTPREVIEW_CLOSE* pNotifyStruct = (NM_SFTPRINTPREVIEW_CLOSE*) pnmh;
    SendMessage(WM_COMMAND, IDCANCEL);
}

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


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