SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftMask/OCX 7.0 - Masked Edit Control
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftPrintPreview/DLL 2.0 - Print Preview Control (discontinued)
SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftDirectory 3.5 - File/Folder Control (discontinued)
SftMask/OCX 7.0 - Masked Edit Control
SftOptions 1.0 - Registry/INI Control (discontinued)
SftPrintPreview/OCX 1.0 - Print Preview Control (discontinued)
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftTabs/NET 6.0 - Tab Control (discontinued)
SftTree/NET 2.0 - Tree Control
Defines the callback function associated with a tab. This callback routine is called by SftTabs/DLL to create and destroy the page associated with a tab.
typedef HWND (CALLBACK* SFTTABS_TABCALLBACK)(BOOL fCreate, HWND hwndOwner, HWND hwndPage, HWND hwndTab);
fCreate
TRUE if creating a new page. If hwndPage is NULL, the page is created for the first time, otherwise the page already exists. When creating a new page, the application should create a modeless dialog or a window. fCreate is FALSE when destroying a page or switching away from a page.
hwndOwner
The window handle of the tab control's parent window. This window should be the owner of any pages created by this callback function. If fCreate is FALSE, hwndOwner can be NULL. In this case, the page hwndPage should be destroyed unconditionally. If hwndOwner is not NULL, the window may be left intact, the tab control is merely switching away from the current page. By returning the page's window handle, the callback can indicate that the window wasn't destroyed. Returning NULL indicates that the page was destroyed.
hwndPage
The window handle of the page to create or destroy. hwndPage may be NULL when the page is created for the first time.
hwndTab
The window handle of the tab control.
The return value is the new page's window handle if fCreate is TRUE. If fCreate is FALSE, hwndOwner is not NULL and the callback hasn't destroyed the page, the return value is the window handle of the page. Otherwise NULL should be returned.
SFTTABS_TABCALLBACK defines the type of the callback function associated with a tab. This callback routine is called by SftTabs/DLL to create and destroy the page associated with a tab.
Callback functions associated with a tab are only used in the C implementation of tabbed dialogs and tabbed windows. They are not used for MFC/C++. For more information on tabbed dialogs and windows, see Implementing Tabbed Dialogs and Implementing Tabbed Windows.
This example supports a page which is kept when switching away from the active tab:
C
HWND CALLBACK Page_Callback(BOOL fCreate, HWND hwndOwner, HWND hwndPage, HWND hwndTab) { if (fCreate) { // creating a new page if (hwndPage) { // already created, we could do some initialization here. // this will be called every time the page becomes active. // The WM_SHOWWINDOW message is also sent to the page and could // be used to determine activation/deactivation of the page. // optional, set the main window's title to the window title defined ... SftTabs_CopyWindowTitle(hwndPage, hwndOwner); return NULL; // return NULL, ignored } else { // Create the page. // You can create and initialize any type of window here, not just dialogs. // Use CreateWindow to create other windows. Don't specify WS_VISIBLE, but // make sure you use WS_TABSTOP. // When creating a non-dialog window, make sure to call SftTabs_SetPageActive // after the page has been created. HWND hwnd = CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_your_dialog_ID), hwndOwner, (DLGPROC)Page_yourDialogProc, (LPARAM)(UINT)hwndTab); // pass tab control as data // optional, set the main window's title to the window title defined ... SftTabs_CopyWindowTitle(hwnd, hwndOwner); return hwnd; } } else { // destroying page if (hwndOwner) // - because we're switching away return hwndPage; // keep the window handle, don't destroy it else { // - because we're closing the main dialog DestroyWindow(hwndPage); return NULL; } } }
This example supports a page which is destroyed every time when switching away from the active tab:
C
HWND CALLBACK Page_Callback(BOOL fCreate, HWND hwndOwner, HWND hwndPage, HWND hwndTab) { if (fCreate) { // creating a new page if (hwndPage) { // already created, we could do some initialization here. // this will be called every time the page becomes active // The WM_CREATE/WM_INITDIALOG/WM_DESTROY messages are also sent to // the page and could be used to determine activation/deactivation. // of the page. // optional, set the main window's title to the window title defined ... SftTabs_CopyWindowTitle(hwndPage, hwndOwner); return NULL; } else { // Create the page. // You can create and initialize any type of window here, not just dialogs. // Use CreateWindow to create other windows. Don't specify WS_VISIBLE, but // make sure you use WS_TABSTOP. // When creating a non-dialog window, make sure to call SftTabs_SetPageActive // after the page has been created. HWND hwnd = CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_your_dialog_ID), hwndOwner, (DLGPROC)Page_yourDialogProc, (LPARAM)(UINT)hwndTab);// pass tab control as data // optional, set the main window's title to the window title defined ... SftTabs_CopyWindowTitle(hwnd, hwndOwner); return hwnd; } } else { // destroying page // We'll always destroy this page (to save resources) DestroyWindow(hwndPage); return NULL; } }
See Also C/C++ API | C++ Classes | Notifications