SftTabs/DLL 6.0

TransparentControls

Softel vdm, Inc.

The dialogs used as pages of a tab control call SftTabs_TransparentControls to pass messages on to SftTabs/DLL so they can be processed.

C

BOOL WINAPI SftTabs_TransparentControls(HWND hwnd,
        SFTTABS_DRAWBACKGROUNDPROC lpfnDrawBackground,
        UINT* lpmessage, WPARAM* lpwParam, LPARAM* lplParam, LRESULT* lplResult,
        DWORD flag, SFTTABS_DWORD_PTR UserData);

Parameters

hwnd

The window handle of the tab page (the message's destination window).

lpfnDrawBackground

The address of an application supplied drawing callback for special background handling. An application can define a background color for a tab page using the SFTTABS_TAB, colorClientArea member (see SetTabInfo) or define a background bitmap using the SFTTABS_CONTROL, hInsideBitmap member (see SetControlInfo). lpfnDrawBackground overrides other background definitions and allows an application to render the background.

lpmessage, wParam, lParam

Message parameters.

lplResult

The message result value. If SftTabs_TransparentControls returns TRUE, this result value should be returned from the dialog procedure.

flag

Defines processing options. Use one of the following values:

0

lpfnDrawBackground is ignored if Windows themes are active.

SFTTABS_DRAWBG_OVERRIDETHEME

lpfnDrawBackground is always honored, even if Windows themes are active.

UserData

An application defined value that is passed to the background drawing callback lpfnDrawBackground as the UserData parameter.

Returns

The return value is TRUE if the message was processed by SftTabs/DLL, otherwise FALSE.

Comments

The TransparentControls function is called by the dialogs used as pages of a tab control to pass messages on to SftTabs/DLL so they can be processed.

If this function is not called, certain features of SftTabs/DLL may not appear to be working correctly, such as background handling, control transparency and transition effects.

When using C, the SftTabs_TransparentControls function handles background painting. It is not used for C++ and MFC. CSftTabsPage::m_lpfnDrawBackground can be used to define special background handling.

Backgrounds are only supported on Windows XP (using Common Controls version 6) and above. While it is possible to enable backgrounds for all environments, most Windows controls will not be rendered correctly. Background colors based on SFTTABS_TAB, colorClientArea are supported in all environments.

Calling SftTabs_TransparentControls is required even if special background handling is not needed, to insure upward compatibility with future releases of this product.

Windows Mobile Edition: SftTabs_TransparentControls is not supported.

Example

This example paints a custom tab page background by filling the tab page with a tiled bitmap.

C

    ...  tab page dialog procedure
    LRESULT lResult;
    if (SftTabs_HandleDialogMessage(hwndDlg, msg, wParam, lParam))
        return TRUE;
    if (SftTabs_TransparentControls(hwndDlg, Page2_DrawBackground, &msg, &wParam, &lParam, &lResult, SFTTABS_DRAWBG_OVERRIDETHEME, 0))
        return lResult;
}
void CALLBACK Page2_DrawBackground(HDC hDC, HWND hwndDlg, HWND hwndTab, SFTTABS_DWORD_PTR UserData)
{
    RECT rect;
    GetClientRect(hwndDlg, &rect);
    SftTabs_PaintTiledBitmap(hDC, m_hBackgroundBitmap, 0, 0, &rect);
}

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


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