Hide

SftTabs/DLL 6.5 - Tab Control

Display
Print

GetEndPageMessage

Retrieves the private message ID sent to a page of a tabbed dialog when the user chooses to switch to another page or to end the tabbed dialog.

C

UINT SftTabs_GetEndPageMessage();

Returns

The return value is the private message ID sent to a page of a tabbed dialog when the user chooses to switch to another page or to end the tabbed dialog.

Comments

The GetEndPageMessage function retrieves the private message ID sent to a page of a tabbed dialog when the user chooses to switch to another page or to end the tabbed dialog.

The returned value is typically used in a page's window procedure or dialog procedure to handle the specified message. This message allows an application to control whether the user can switch to another page. When a page receives the message defined by SftTabs_GetEndPageMessage, it can return TRUE to prevent the user from switching to another page or FALSE to allow the page switch.

This function is used to determine the private Windows message used by the tab control, instead of WM_QUERYENDSESSION. While WM_QUERYENDSESSION continues to be supported, an application can implement support for WM_QUERYENDSESSION or the private message defined by SftTabs_GetEndPageMessage.

Examples

C

}

BOOL CALLBACK Page2_DialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
    LRESULT lResult;

#if !defined(DEPRECATED) // NEW METHOD
    // we're phasing out the use of WM_QUERYENDSESSION
    // while still fully supported, SftTabs_GetEndPageMessage should be used to
    // test for the "end-page" message.
    if (msg == SftTabs_GetEndPageMessage()) {
        BOOL fEnd = (BOOL) SendMessage(GetDlgItem(hwndDlg, IDC_P2_CHECK1), BM_GETCHECK, 0, 0) != 0;
        if (!fEnd) {
            MessageBox(hwndDlg, TEXT("Please check the checkbox on the dialog to be able to switch to another tab."),
                    TEXT("Sample"), MB_APPLMODAL|MB_ICONSTOP|MB_OK);
            SetWindowLong(hwndDlg, DWLP_MSGRESULT, TRUE); // cancel page switching

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


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