SftTabs/DLL 6.0

GetEndPageMessage

Softel vdm, Inc.

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. WM_QUERYENDSESSION is not supported on Windows Mobile platforms.

Example

This example of a page's dialog procedure prevents switching to another tab if the input data is invalid.

C

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

    if (msg == SftTabs_GetEndPageMessage()) {
        if (!InputFieldsValid()) {
            MessageBox(hwndDlg, TEXT("Invalid Input!"), TEXT("Sample"), MB_APPLMODAL|MB_ICONSTOP|MB_OK);
            SetWindowLong(hwndDlg, DWLP_MSGRESULT, TRUE); // cancel page switching
            // this is a dialog proc, so we can't simply return True/False
            // we have to use SetWindowLong instead. In a regular window proc
            // we could simply return True/False
        }
        return TRUE; // message handled
    }

    switch (msg) {
    case WM_INITDIALOG:
        ....
    }

    if (SftTabs_HandleDialogMessage(hwndDlg, msg, wParam, lParam))
        return TRUE;
    if (SftTabs_TransparentControls(hwndDlg, Page2_DrawBackground, &msg, &wParam, &lParam, &lResult, SFTTABS_DRAWBG_OVERRIDETHEME, 0))
        return (BOOL) lResult;

    return FALSE;
}

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


Feedback / comments / error reports for this topic
© 2016 - Softel vdm, Inc. - www.softelvdm.com