Hide

SftTabs/DLL 6.5 - Tab Control

Display
Print

ActivatePage

Activates a page.

C

BOOL WINAPI SftTabs_ActivatePage(HWND hwndParent, HWND hwndCtl, HWND hwndFrame, BOOL fInitializing);

Parameters

hwndParent

The window handle of the tab control's parent window.

hwndCtl

The window handle of the tab control.

hwndFrame

The window handle of a window to be used by SftTabs/DLL as client area for tabbed dialogs. This parameter should be NULL to use a tab control's built-in client area. If a window handle is specified, SftTabs/DLL uses the client area size and location as a replacement for the tab control's client area. The window described by hwndFrame may be hidden and/or disabled. If an application resizes or moves the frame window, the dependent page or windows control also has to be resized by using the ResizePages function. Using this frame window handle, the client area of a tab control can be located anywhere in relation to the tab control even on a different dialog or window.

fInitializing

Set to TRUE when the tabbed dialog is being created and is not yet visible (usually during WM_INITDIALOG or WM_CREATE message handling), set to FALSE when the tab control is already visible.

Returns

The return value is TRUE if the function was successful, otherwise FALSE is returned.

Comments

The ActivatePage function activates a page.

The parent window of a tab control calls the SftTabs_ActivatePage function after a new page has been activated or to activate the initial page.

The SftTabs_ActivatePage function causes the tab callback routine SFTTABS_TABCALLBACK, responsible for the current tab, to be called to create or initialize the new page.

If a page is already active, SftTabs_DeactivatePage should be used first to deactivate that page before calling SftTabs_ActivatePage.

Example

This C example shows the end of a typical tabbed dialog WM_INITDIALOG message handler:


... additional initialization code ...

index = SftTabs_AddTab(hwndTab, TEXT("&Six"));
SftTabs_SetTabInfo(hwndTab, index, &Tab5);
SftTabs_SetControlInfo(hwndTab, &CtlInit);
SftTabs_SetCurrentTab(hwndTab, 0);

// Make sure to turn redraw back on
SendMessage(hwndTab, WM_SETREDRAW, (WPARAM)TRUE, 0);
InvalidateRect(hwndTab, NULL, TRUE);

// Activate current page.
SftTabs_ActivatePage(hwndParent, hwndTab, NULL, TRUE);

// Mark the window as a main, tabbed dialog (so accel. keys work) by registering it.
// Register the dialog AFTER activating the current page
SftTabs_RegisterDialog(hwndParent);

return FALSE; // WM_INITDIALOG, input focus already set

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


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