# SftTabs/DLL 7.0 — API Reference > Complete A-Z reference for SftTabs/DLL 7.0. The guide and feature documentation is in https://softelvdm.com/Vault/Softelvdm.com/llms/SftTabs-DLL-7.0.txt Online documentation: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200 ## Notifications *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications* The parent window of a tab control receives the following event notifications using the WM_COMMAND messages. WM_COMMAND: ``` NotifyCode = HIWORD(wParam); idItem = LOWORD(wParam); hwndCtl = (HWND) lParam; ``` | ***NotifyCode*** | ***Description*** | | --- | --- | | SFTTABSN_CLIENTAREACHANGE | The tab control's [client area](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/pop_clientarea) has been resized or its position has changed. | | SFTTABSN_CLOSEBUTTON | The Close button was clicked. This notification only occurs if the fSendWMCLOSE member of the [SFTTABS_CONTROL](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/struct_sfttabs_control) was defined as FALSE. Otherwise, the tab control sends the [WM_CLOSE](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_windows_messages) message to the tab control's parent window. | | [SFTTABSN_DARKMODE_CHANGED](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_darkmode) | The active [dark mode](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_darkmode) state flipped. This notification is sent when SetDarkMode is SFTTABS_DARKMODE_AUTO and the Windows "Choose your mode" setting changes, or when SetDarkMode programmatically switches modes. Use IsDarkModeActive to read the current state. | | [SFTTABSN_DPI_CHANGED](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_dpi) | The monitor DPI changed. This notification is sent to Per-Monitor v2 DPI-aware hosts when the tab control's window moves to a monitor of a different DPI, or the system DPI changes. Use GetDPI to read the new value. The application should re-send WM_SETFONT with a font sized for the new DPI; caller-supplied tab pictures should be re-registered at the new physical size unless [SetImageScaling](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_imagescaling) is SFTTABS_IMAGESCALING_STRETCH. | | SFTTABSN_DRAGDROP | The user released the left mouse button and ended tab reordering or drag & drop. Use the [GetDragInfo](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_getdraginfo) function to determine the action required. | | SFTTABSN_DRAGMOVE | The user moved the mouse cursor while tab reordering or drag & drop is active. The application can use the GetDragInfo and [SetDragInfo](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_setdraginfo) functions to retrieve information and to control tab reordering and drag & drop. By sending a WM_CANCELMODE message, an application can cancel tab reordering and drag & drop. | | SFTTABSN_DRAGSTART | The user initiated tab reordering or drag & drop by pressing the left mouse button on a tab and dragging the tab. By sending a WM_CANCELMODE message, an application can cancel tab reordering and drag & drop. | | [SFTTABSN_HIGHCONTRAST_CHANGED](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_highcontrast) | The [Windows High Contrast](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_highcontrast) [accessibility](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_accessibility) state flipped. This notification is sent when SetHighContrastMode is SFTTABS_HIGHCONTRAST_AUTO and the user toggles the system High Contrast setting. Use IsHighContrastActive to read the current state. | | SFTTABSN_LBUTTONDBLCLK | The tab control received a WM_LBUTTONDBLCLK message. This notification is only generated if the mouse cursor is not located on a tab. | | SFTTABSN_LBUTTONDOWN | The tab control received a WM_LBUTTONDOWN message. This notification is only generated if the mouse cursor is not located on a tab. | | SFTTABSN_LBUTTONDBLCLK_AREA | The tab control received a WM_LBUTTONDBLCLK message. This notification is only generated if the mouse cursor is located on a tab, but neither on the tab text nor on the tab picture. The [GetNextTab](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_getnexttab) function can be used to determined the tab that is being clicked. Following this notification, tab switching may occur. This can be cancelled by sending the the Windows message WM_CANCELMODE to the tab control. | | SFTTABSN_LBUTTONDOWN_AREA | The tab control received a WM_LBUTTONDOWN message. This notification is only generated if the mouse cursor is located on a tab, but neither on the tab text nor on the tab picture. The GetNextTab function can be used to determined the tab that is being clicked. Following this notification, tab switching may occur. This can be cancelled by sending the the Windows message WM_CANCELMODE to the tab control. | | SFTTABSN_LBUTTONDBLCLK_IMAGE | The tab control received a WM_LBUTTONDBLCLK message. This notification is only generated if the mouse cursor is located on the tab picture of a tab. The GetNextTab function can be used to determined the tab that is being clicked. Following this notification, tab switching may occur. This can be cancelled by sending the the Windows message WM_CANCELMODE to the tab control. | | SFTTABSN_LBUTTONDBLCLK_IMAGE2 | The tab control received a WM_LBUTTONDBLCLK message. This notification is only generated if the mouse cursor is located on the second tab picture of a tab. The GetNextTab function can be used to determined the tab that is being clicked. Following this notification, tab switching may occur. This can be cancelled by sending the the Windows message WM_CANCELMODE to the tab control. This notification is typically used to implement a tab Close button for a tab. When implementing custom behavior, such as closing the associated page by removing the tab, the WM_CANCELMODE must be sent, otherwise the notification causes tab switching. | | SFTTABSN_LBUTTONDOWN_IMAGE | The tab control received a WM_LBUTTONDOWN message. This notification is only generated if the mouse cursor is located on the tab picture of a tab. The GetNextTab function can be used to determined the tab that is being clicked. Following this notification, tab switching may occur. This can be cancelled by sending the the Windows message WM_CANCELMODE to the tab control. | | SFTTABSN_LBUTTONDOWN_IMAGE2 | The tab control received a WM_LBUTTONDOWN message. This notification is only generated if the mouse cursor is located on the second tab picture of a tab. The GetNextTab function can be used to determined the tab that is being clicked. Following this notification, tab switching may occur. This can be cancelled by sending the the Windows message WM_CANCELMODE to the tab control. This notification is typically used to implement a tab Close button for a tab. When implementing custom behavior, such as closing the associated page by removing the tab, the WM_CANCELMODE must be sent, otherwise the notification causes tab switching. | | SFTTABSN_LBUTTONDBLCLK_TEXT | The tab control received a WM_LBUTTONDBLCLK message. This notification is only generated if the mouse cursor is located on the tab text of a tab. The GetNextTab function can be used to determined the tab that is being clicked. Following this notification, tab switching may occur. This can be cancelled by sending the the Windows message WM_CANCELMODE to the tab control. | | SFTTABSN_LBUTTONDOWN_TEXT | The tab control received a WM_LBUTTONDOWN message. This notification is only generated if the mouse cursor is located on the tab text of a tab. The GetNextTab function can be used to determined the tab that is being clicked. Following this notification, tab switching may occur. This can be cancelled by sending the the Windows message WM_CANCELMODE to the tab control. | | SFTTABSN_KILLFOCUS | The tab control lost the input focus. | | SFTTABSN_LAYOUT | The layout of the tabs within the tab control has changes (rows or tabs may have been reordered or repositioned within the tab control). | | SFTTABSN_MBUTTONDBLCLK | The tab control received a WM_MBUTTONDBLCLK message which it doesn't process. This notification is only generated if the mouse cursor is located on a tab. | | SFTTABSN_MBUTTONDOWN | The tab control received a WM_MBUTTONDOWN message which it doesn't process. This notification is only generated if the mouse cursor is located on a tab. | | SFTTABSN_MINIMIZEBUTTON | The Minimize button was clicked. | | SFTTABSN_MOUSEMOVE | The tab control received a WM_MOUSEMOVE message. | | SFTTABSN_RBUTTONDBLCLK | The tab control received a WM_RBUTTONDBLCLK message which it doesn't process. This notification is only generated if the mouse cursor is located on a tab. | | SFTTABSN_RBUTTONDOWN | The tab control received a WM_RBUTTONDOWN message which it doesn't process. This notification is only generated if the mouse cursor is located on a tab. | | SFTTABSN_RESTOREBUTTON | The Restore button was clicked. | | SFTTABSN_SCROLLED | The user has caused scrolling of the tabs shown, by pressing a [scroll button](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/pop_scrollbutton) or by using the keyboard interface. | | SFTTABSN_SETFOCUS | The tab control received the input focus. | | SFTTABSN_SIZECHANGED | The tab control received a WM_SIZE message. | | SFTTABSN_SWITCHED | The tab control has been switched to a new tab, which is now active. | | SFTTABSN_SWITCHING | The user has initiated a switch to another tab. This notification signals that the tab control is about to switch away from the [current tab](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/pop_activetab) to a new tab. The application can cancel switching to the new tab by sending a WM_CANCELMODE message to the tab control. If the application doesn't cancel the switching, the new tab will be activated and a SFTTABSN_SWITCHED notification is sent to the parent window. | | SFTTABSN_SWITCHINGDISABLED | The user has clicked on a disabled tab. No tab switching takes place. The application can display messages informing the end-user that a disabled tab was clicked, or it can even switch to another tab if desired ([SetCurrentTab](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_setcurrenttab)). | | SFTTABSN_TTPOP | The tab control is about to hide the [ToolTip](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_tooltips) currently shown for a tab. | | SFTTABSN_TTSHOW | The tab control is about to display a ToolTip for a tab. | See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) ## Window Styles *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_windowstyles* The following tab control window styles are available in addition to the standard window styles (such as WS_BORDER, WS_TABSTOP, etc.). The tab control styles can be retrieved using GetWindowLong. It is not possible to set the styles using SetWindowLong. These styles are used to describe the features available with the [current tab](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/pop_activetab) control. [SetControlInfo](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_setcontrolinfo) can be used to change tab control attributes. Once a tab style has been defined using SetControlInfo by supplying a *style* value in the [SFTTABS_CONTROL](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/struct_sfttabs_control) structure, the tab control sets the window style bits listed below to indicate what features the current tab control supports. The actual tab style (SFTTABSSTYLE_*xxx*) can also be found in the window's style information. For an up-to-date list of style values, see the header file SftTb.h in the directory \Program Files (x86)\Softelvdm\SftTabs DLL 7.0\Include (unless changed during installation). #### SFTTABSSTYLE_CLIENTAREA (0x2000L) This style bit is used to determine if the current tab control supports a [client area](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/pop_clientarea). If this style bit is on, the tab control can be defined as having a client area (using SFTTABS_CONTROL, *fClientArea*). #### SFTTABSSTYLE_HORIZONTAL (0x1000L) This style bit is used to determine the basic orientation of [tab rows](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/pop_tabrows). If this style bit is on, the tab control's tabs are arranged horizontally within one row, otherwise they are arranged vertically. #### SFTTABSSTYLE_MARGIN (0x0400L) The tab control supports left and right margins between the tab control border and the first tab. #### SFTTABSSTYLE_MULTILINE (0x0100L) The tab control supports multiline tab labels if this style bit is on, otherwise only single line labels are available. #### SFTTABSSTYLE_MULTIROW (0x0800L) The tab control supports more than one row of tabs if this style bit is on. #### SFTTABSSTYLE_SCROLLABLE (0x0200L) The tab control supports scrollable tabs if this style bit is on. #### SFTTABSSTYLE_THEMED (0x4000L) The tab control supports [Windows themes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_using_themes) if this style bit is on. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## Extended Window Styles *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_windowstyles_ext* The tab control does not offer any custom extended window styles. Only the standard extended window styles (such as WS_EX_CLIENTEDGE, WS_EX_TOOLWINDOW, etc.) are available. Please see the Windows API reference for more information. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## Windows Messages *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_windows_messages* ### WM_CLOSE The WM_CLOSE message notifies a window that the user clicked the Close button in the tab control. #### Parameters hwnd = (HWND) wParam; Window handle of the tab control. #### Comments A parent window can process this message, typically by closing itself or a dependent window. This message only occurs if the fSendWMCLOSE member of the [SFTTABS_CONTROL](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/struct_sfttabs_control) was defined as TRUE. Otherwise, the tab control sends the [SFTTABSN_CLOSEBUTTON](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) notification to the tab control's parent window. ### WM_CONTEXTMENU The WM_CONTEXTMENU message notifies a window that the user clicked the right mouse button in the tab control. #### Parameters hwnd = (HWND) wParam; Window handle of the tab control. xPos = LOWORD(lParam); Horizontal position of the cursor, in screen coordinates, at the time of the mouse click. yPos = HIWORD(lParam); Vertical position of the cursor, in screen coordinates, at the time of the mouse click. #### Comments A window can process this message by displaying a context menu using the TrackPopupMenu or TrackPopupMenuEx function. ### WM_CTLCOLORSTATIC The WM_CTLCOLORSTATIC message is sent to the parent window of a tab control. #### Comments Using [GetCtlColors](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_getctlcolors) and [SetCtlColors](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_setctlcolors) is the preferred method to change color attributes. Although a tab control generates WM_CTLCOLOR messages, the WM_CTLCOLOR message handling is provided for compatibility with SftTabs 2.0 only. ### WM_QUERYENDSESSION The WM_QUERYENDSESSION message is sent to a page of a tabbed dialog when the user chooses to switch to another page or to end the tabbed dialog. #### Returns The return value specifies what action is to be taken. Return TRUE to prevent the tab control from switching to another page, or return FALSE to allow switching to another tab. #### Comments This message is only used for tabbed dialogs implemented using the C API and the techniques shown in Implementing Tabbed Dialogs. The C++ implementation of tabbed dialogs does not generate or use this message. If a page (or dialog procedure) doesn't handle this message, tab switching is automatic and always possible. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | Notifications ## C/C++ API *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api* An application communicates with the SftTabs/DLL tab control by sending messages using the Windows SendMessage function. To simplify the process, SftTabs/DLL offers predefined macros for messages. This eliminates the casting of parameters and the use of SendMessage. ### Definitions and Structures | Name | Description | | --- | --- | | [SFTTABS_CLASS](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/def_sfttabs_class) | Defines the SftTabs/DLL control window class name. | | [SFTTABS_COLORS](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/struct_sfttabs_colors) | Used with [GetCtlColors](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_getctlcolors) and [SetCtlColors](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_setctlcolors) to retrieve and set a tab control's color attributes. | | [SFTTABS_CONTROL](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/struct_sfttabs_control) | Used to describe a tab control's layout and attributes. | | [SFTTABS_DRAGINFO](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/struct_sfttabs_draginfo) | Used with [GetDragInfo](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_getdraginfo)/[SetDragInfo](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_setdraginfo) during tab reordering and drag & drop. | | [SFTTABS_DRAWBACKGROUNDPROC](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/typedef_sfttabs_drawbackgroundproc) | Defines the type of a user-supplied drawing callback routine called by SftTabs/DLL, which paints the tab page [background](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_background). | | [SFTTABS_DRAWINFO](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/struct_sfttabs_drawinfo) | Passed to an application defined callback routine which can calculate the size or paint the tab labels. | | [SFTTABS_DRAWPROCPARM](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/struct_sfttabs_drawprocparm) | Used as a parameter for [SetDrawTabCallback](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_setdrawtabcallback) to define an application-specific drawing callback routine, which paints the tab labels. | | [SFTTABS_DRAWTABPROC](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/typedef_sfttabs_drawtabproc) | Defines the type of a user-supplied drawing callback routine called by SftTabs/DLL, which paints the tab labels. | | [SFTTABS_DWORD_PTR](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/typedef_sfttabs_dword_ptr) | Represents a type large enough to hold a DWORD or pointer value. | | [SFTTABS_GRAPH](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/struct_sfttabs_graph) | Describes a tab's picture component and its location. | | [SFTTABS_LONG_PTR](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/typedef_sfttabs_long_ptr) | Represents a type large enough to hold a long or pointer value. | | [SFTTABS_MAXROWS](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/def_sfttabs_maxrows) | Defines the maximum number of [tab rows](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/pop_tabrows). | | [SFTTABS_MAXTABS](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/def_sfttabs_maxtabs) | Defines the maximum number of tabs per tab control. | | [SFTTABS_NOCOLOR](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/def_sfttabs_nocolor) | Indicates that the default color should be used. | | [SFTTABS_STATIC](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/def_sfttabs_static) | Defines static [linking](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_buildingapp) of SftTabs/DLL to an application. | | [SFTTABS_STYLETABLEA](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/struct_sfttabs_styletablea) | Describes each available tab style. | | [SFTTABS_TAB](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/struct_sfttabs_tab) | Describes one tab label, including its colors, picture and text components. | | [SFTTABS_TABCALLBACK](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/typedef_sfttabs_tabcallback) | 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. | ### Messages and Functions | Name | Description | | --- | --- | | [SftTabs_ActivatePage](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_activatepage) | Activates a page. | | [SftTabs_AddTab](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_addtab) | Adds a new tab to a tab control. The new tab will be added as the last tab. | | [SftTabs_AdjustClientRect](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_adjustclientrect) | Calculates a tab control size which will provide a [client area](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/pop_clientarea) of the given size. | | [SftTabs_Announce](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_announce) | Pushes short application-status text to attached [screen readers](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_accessibility) through a UI Automation notification event. | | [SftTabs_ClosePossible](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_closepossible) | The parent window of a tab control calls the SftTabs_ClosePossible function to test if a tabbed dialog or window can be ended. | | [SftTabs_CopyWindowTitle](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_copywindowtitle) | Copies the window caption of a window to another window. | | [SftTabs_DeactivatePage](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_deactivatepage) | The parent window of a tab control calls the SftTabs_DeactivatePage function to signal that the current page is no longer the active page. | | [SftTabs_DeleteTab](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_deletetab) | Deletes a tab from the tab control. | | [SftTabs_Destroy](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_destroy) | The parent window of a tab control calls SftTabs_Destroy when the parent window is about to be destroyed. | | [SftTabs_DrawSelectionOutline](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_drawselectionoutline) | Draws a selection outline. | | [SftTabs_FreeGDIPlusImageLoadedFromFile](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_freegdiplusimageloadedfromfile) | Deletes a [GDI+](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_gdiplus) image obtained using [SftTabs_LoadGDIPlusImageFromFile](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_loadgdiplusimagefromfile). | | [SftTabs_FreeGDIPlusImageLoadedFromResource](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_freegdiplusimageloadedfromresource) | Deletes a GDI+ image obtained using [SftTabs_LoadGDIPlusImageFromResource](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_loadgdiplusimagefromresource). | | [SftTabs_GetAllowAllInactive](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_getallowallinactive) | Enables all tabs to become inactive. | | [SftTabs_GetControlInfo](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_getcontrolinfo) | Retrieves tab control attributes. | | [SftTabs_GetCount](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_getcount) | Retrieves the number of tabs in a tab control. | | SftTabs_GetCtlColors | Returns the tab control's color attributes. | | [SftTabs_GetCurrentTab](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_getcurrenttab) | Retrieves the index of the currently [active tab](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/pop_activetab). | | [SftTabs_GetDarkMode](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_darkmode) | Returns the current [dark mode](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_darkmode) setting. | | [SftTabs_GetDPI](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_dpi) | Returns the effective DPI for the monitor the tab control is currently displayed on. | | SftTabs_GetDragInfo | Returns the drag & drop information while handling [SFTTABSN_DRAGMOVE](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications)/SFTTABSN_DRAGDROP notifications. | | [SftTabs_GetEndPageMessage](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_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. | | [SftTabs_GetGDIPlusAvailable](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_gdiplusavailable) | Returns whether GDI+ support is available. | | [SftTabs_GetHighContrastMode](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_highcontrast) | Returns the current [high contrast mode](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_highcontrast) setting. | | [SftTabs_GetImageScaling](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_imagescaling) | Returns the current image DPI scaling mode. | | [SftTabs_GetNextTab](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_getnexttab) | Retrieves the index of the next tab about to become active. | | [SftTabs_GetPixelScaling](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_pixelscaling) | Returns the current pixel-dimension DPI scaling mode. | | [SftTabs_GetStyleTable](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_getstyletable) | Returns a pointer to the style table. The style table describes all available tab styles, suitable for use by a resource editor. | | [SftTabs_GetTabControlFromPage](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_gettabcontrolfrompage) | Returns the tab control window handle, given the window handle of a window attached to a tab. | | [SftTabs_GetTabInfo](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_gettabinfo) | Retrieves tab attributes. | | [SftTabs_GetTabLabel](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_gettablabel) | Retrieves a tab's text. | | [SftTabs_GetTabLabelLen](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_gettablabellen) | Retrieves the length of a tab's text. | | [SftTabs_GetToolTip](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_gettooltip) | Retrieves a tab's [ToolTip](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_tooltips) text. | | [SftTabs_GetToolTipHandle](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_gettooltiphandle) | Returns the window handle of the ToolTip control used by the tab control. | | [SftTabs_GetToolTipLen](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_gettooltiplen) | Retrieves the length of a tab's ToolTip text. | | [SftTabs_GetVisibleCount](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_getvisiblecount) | Retrieves the count of visible tabs. | | [SftTabs_HandleDialogMessage](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_handledialogmessage) | The parent dialog window of a tab control and the dialogs used as pages of a tab control call SftTabs_HandleDialogMessage to pass messages on to SftTabs/DLL so they can be processed. | | [SftTabs_HandleWindowMessage](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_handlewindowmessage) | The parent window of a tab control and the windows or dialogs used as pages of a tab control call SftTabs_HandleWindowMessage to pass messages on to SftTabs/DLL so they can be processed. | | [SftTabs_HitTest](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_hittest) | Determines the tab index of the tab at a given location. | | [SftTabs_InsertTab](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_inserttab) | Inserts a new tab at the specified position. | | SftTabs_IsDarkModeActive | Returns TRUE if dark mode is currently active on the tab control. | | SftTabs_IsHighContrastActive | Returns TRUE if Windows High Contrast mode is currently active on the tab control. | | [SftTabs_IsHiRes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_ishires) | Returns whether high resolution support is enabled. | | [SftTabs_IsRegisteredDialog](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_isregistereddialog) | Determines whether a given dialog is registered with SftTabs/DLL for special tabbed dialog or tabbed window handling, such as accelerator key handling, ESCAPE and TAB key processing, etc. | | SftTabs_IsRegisteredWindow | Determines whether a given window is registered with SftTabs/DLL for special tabbed dialog or tabbed window handling, such as accelerator key handling, ESCAPE and TAB key processing, etc. | | [SftTabs_IsTabControl](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_istabcontrol) | Determines whether a given window is a tab control. | | [SftTabs_IsTabControlWithDialog](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_istabcontrolwithdialog) | Determines whether a given window is a tab control with an attached page. | | SftTabs_IsTabControlWithPage | Determines whether a given window is a tab control with an attached page. | | SftTabs_LoadGDIPlusImageFromFile | Loads a GDI+ image from a file. | | SftTabs_LoadGDIPlusImageFromResource | Loads a GDI+ image from an application's or DLL's resources. | | [SftTabs_MoveTab](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_movetab) | Moves a tab within a tab control. | | [SftTabs_PaintBitmap](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_paintbitmap) | Paints a bitmap. | | [SftTabs_PaintTiledBitmap](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_painttiledbitmap) | Paints a bitmap, tiling it if necessary. | | [SftTabs_QueryChar](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_querychar) | Tests if a tab control responds to the specified character, i.e. the character is an accelerator key which the tab control processes. | | [SftTabs_RegisterApp](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_registerapp) | Registers the application for use of SftTabs/DLL controls. | | [SftTabs_RegisterDialog](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_registerdialog) | Registers a dialog containing a tab control. | | SftTabs_RegisterWindow | Registers a window containing a tab control. | | [SftTabs_ResetContent](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_resetcontent) | Removes all tabs from a tab control. | | [SftTabs_ResizePages](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_resizepages) | Resizes attached pages when using a frame window. | | [SftTabs_ScrollTabs](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_scrolltabs) | Scrolls tabs in the direction specified. | | [SftTabs_SetAllowAllInactive](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_setallowallinactive) | Enables all tabs to become inactive. | | [SftTabs_SetControlInfo](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_setcontrolinfo) | Sets tab control attributes. | | SftTabs_SetCtlColors | Sets the tab control's color attributes. | | [SftTabs_SetCurrentTab](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_setcurrenttab) | Makes the specified tab the new active tab. | | [SftTabs_SetCurrentTabEx](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_setcurrenttabex) | Makes the specified tab the new active tab. | | SftTabs_SetDarkMode | Sets the dark mode setting. | | SftTabs_SetDragInfo | Updates the drag & drop information while handling SFTTABSN_DRAGMOVE/SFTTABSN_DRAGDROP notifications. | | SftTabs_SetDrawTabCallback | Defines a drawing callback routine used to paint tab labels. | | SftTabs_SetHighContrastMode | Sets the high contrast mode setting. | | SftTabs_SetImageScaling | Sets the image DPI scaling mode. | | [SftTabs_SetPageActive](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_setpageactive) | Notifies a tab control that the page attached to the currently active tab has been activated. | | [SftTabs_SetPageInactive](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_setpageinactive) | Notifies a tab control that the page attached to the currently active tab has been deactivated. | | SftTabs_SetPixelScaling | Sets the pixel-dimension DPI scaling mode. | | [SftTabs_SetTabInfo](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_settabinfo) | Sets the tab attributes for the specified tab. | | [SftTabs_SetTabLabel](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_settablabel) | Sets a tab's text. | | [SftTabs_SetToolTip](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_settooltip) | Sets a tab's ToolTip text. | | [SftTabs_SetVersion](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_setversion) | Sets the SftTabs/DLL version an application requires. | | [SftTabs_SwitchTab](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_switchtab) | Switches to the next/previous tab. | | [SftTabs_TransparentControls](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_transparentcontrols) | The dialogs used as pages of a tab control call SftTabs_TransparentControls to pass messages on to SftTabs/DLL so they can be processed. | | [SftTabs_UnregisterApp](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_unregisterapp) | Unregisters the application. | | [SftTabs_UnregisterDialog](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_unregisterdialog) | Unregisters a dialog which has been previously registered using SftTabs_RegisterDialog or SftTabs_RegisterWindow. | | SftTabs_UnregisterWindow | Unregisters a window which has been previously registered using SftTabs_RegisterDialog or SftTabs_RegisterWindow. | See Also [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | Notifications ## C++ Classes *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses* | Class | Description | | --- | --- | | CSftTabs | Tab control. | | CSftTabsDialog | Tabbed dialog. | | CSftTabsPage | Page of a tabbed dialog. | | CSftTabsWindowSheet | Tabbed window. | | CSftTabsWindowPage | Page of a tabbed window. | ### CSftTabs Class, Member Functions CSftTabs is derived from CWnd. | Member | Description | | --- | --- | | [AddTab](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_addtab) | Adds a new tab to a tab control. The new tab will be added as the last tab. | | [AdjustClientRect](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_adjustclientrect) | Calculates a tab control size which will provide a [client area](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/pop_clientarea) of the given size. | | [Announce](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_announce) | Pushes short application-status text to attached [screen readers](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_accessibility) through a UI Automation notification event. | | [Create](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabs_create) | Creates a tab control window and attaches it to the CSftTabs object. | | [CSftTabs](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabs_csfttabs) | Standard constructor. | | [DeleteTab](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_deletetab) | Deletes a tab from the tab control. | | [GetAllowAllInactive](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_getallowallinactive) | Enables all tabs to become inactive. | | [GetControlInfo](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_getcontrolinfo) | Retrieves tab control attributes. | | [GetCount](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_getcount) | Retrieves the number of tabs in a tab control. | | [GetCtlColors](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_getctlcolors) | Returns the tab control's color attributes. | | [GetDarkMode](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_darkmode) | Returns the current [dark mode](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_darkmode) setting. | | [GetDPI](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_dpi) | Returns the effective DPI for the monitor the tab control is currently displayed on. | | [GetDragInfo](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_getdraginfo) | Returns the drag & drop information while handling [SFTTABSN_DRAGMOVE](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications)/SFTTABSN_DRAGDROP notifications. | | [GetHighContrastMode](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_highcontrast) | Returns the current [high contrast mode](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_highcontrast) setting. | | [GetImageScaling](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_imagescaling) | Returns the current image DPI scaling mode. | | [GetCurrentTab](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_getcurrenttab) | Retrieves the index of the currently [active tab](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/pop_activetab). | | [GetNextTab](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_getnexttab) | Retrieves the index of the next tab about to become active. | | [GetPixelScaling](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_pixelscaling) | Returns the current pixel-dimension DPI scaling mode. | | [GetTabDialog](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabs_gettabdialog) | Retrieves the CSftTabsPage based object attached to the specified tab. | | [GetTabInfo](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_gettabinfo) | Retrieves tab attributes. | | [GetTabLabel](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_gettablabel) | Retrieves a tab's text. | | [GetTabLabelLen](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_gettablabellen) | Retrieves the length of a tab's text. | | [GetTabWindowPage](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabs_gettabwindowpage) | Retrieves the CSftTabsWindowPage based object attached to the specified tab. | | [GetToolTip](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_gettooltip) | Retrieves a tab's [ToolTip](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_tooltips) text. | | [GetToolTipLen](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_gettooltiplen) | Retrieves the length of a tab's ToolTip text. | | [GetVisibleCount](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_getvisiblecount) | Retrieves the count of visible tabs. | | [HitTest](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_hittest) | Determines the tab index of the tab at a given location. | | [InsertTab](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_inserttab) | Inserts a new tab at the specified position. | | IsDarkModeActive | Returns TRUE if dark mode is currently active on the tab control. | | IsHighContrastActive | Returns TRUE if Windows High Contrast mode is currently active on the tab control. | | [MoveTab](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_movetab) | Moves a tab within a tab control. | | [QueryChar](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_querychar) | Tests if a tab control responds to the specified character, i.e. the character is an accelerator key which the tab control processes. | | [RegisterApp](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_registerapp) | Registers the application for use of SftTabs/DLL controls. | | [ResetContent](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_resetcontent) | Removes all tabs from a tab control. | | [ResizePages](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_resizepages) | Resizes attached pages when using a frame window. | | [ScrollTabs](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_scrolltabs) | Scrolls tabs in the direction specified. | | [SetAllowAllInactive](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_setallowallinactive) | Enables all tabs to become inactive. | | [SetControlInfo](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_setcontrolinfo) | Sets tab control attributes. | | [SetCtlColors](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_setctlcolors) | Sets the tab control's color attributes. | | [SetCurrentTab](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_setcurrenttab) | Makes the specified tab the new active tab. | | [SetCurrentTabEx](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_setcurrenttabex) | Makes the specified tab the new active tab. | | SetDarkMode | Sets the dark mode setting. | | [SetDragInfo](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_setdraginfo) | Updates the drag & drop information while handling SFTTABSN_DRAGMOVE/SFTTABSN_DRAGDROP notifications. | | [SetDrawTabCallback](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_setdrawtabcallback) | Defines a drawing callback routine used to paint tab labels. | | SetHighContrastMode | Sets the high contrast mode setting. | | SetImageScaling | Sets the image DPI scaling mode. | | SetPixelScaling | Sets the pixel-dimension DPI scaling mode. | | [SetTabDialog](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabs_settabdialog) | Sets the CSftTabsPage based object pointer attached to the specified tab. | | [SetTabInfo](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_settabinfo) | Sets the tab attributes for the specified tab. | | [SetTabLabel](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_settablabel) | Sets a tab's text. | | [SetTabWindowPage](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabs_settabwindowpage) | Sets the CSftTabsWindowPage based object pointer attached to the specified tab. | | [SetToolTip](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_settooltip) | Sets a tab's ToolTip text. | | [SetVersion](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_setversion) | Sets the SftTabs/DLL version an application requires. | | [SwitchTab](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_switchtab) | Switches to the next/previous tab. | | [UnregisterApp](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_unregisterapp) | Unregisters the application. | ### CSftTabsDialog Class, Member Functions The class CSftTabsDialog describes a main, tabbed dialog. A CSftTabsDialog based dialog is created using a dialog resource defined using a resource editor. A CSftTabsDialog based dialog contains at least one tab control (CSftTabs based) and optionally buttons, such as OK, Cancel, and other Windows controls. CSftTabsDialog is derived from CDialog. | Member | Description | | --- | --- | | [ClosePossible](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabsdialog_closepossible) | Determines whether a tabbed dialog can be closed. | | [CSftTabsDialog](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabsdialog_csfttabsdialog) | Standard constructor. | | [GetModified](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabsdialog_getmodified) | Retrieves the current data modification flag for the tabbed dialog. | | [InitializeTabControl](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabsdialog_initializetabcontrol) | Initializes a tab control in a tabbed dialog. Activates the specified tab and the associated page. | | [m_fInitializing](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabsdialog_m_finitializing) | Defines the current initialization status. | | [m_fModified](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabsdialog_m_fmodified) | Defines the current data modification status. | | [OnCancel](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabsdialog_oncancel) | Called when the user hits the ESCAPE key or clicks the Cancel button (the button with an ID of IDCANCEL). | | [OnOK](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabsdialog_onok) | Called when the user clicks the OK button (the button with an ID of IDOK). | | [SetClose](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabsdialog_setclose) | Signals that data has been changed permanently and the tabbed dialog can no longer be Cancel'ed. | | [SetModified](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabsdialog_setmodified) | Sets the current data modification flag for the tabbed dialog. | ### CSftTabsPage Class, Member Functions The class CSftTabsPage describes a dialog (called page) attached to a tab control, which is embedded in a CSftTabsDialog based dialog. A CSftTabsPage based dialog is created using a dialog resource defined using a resource editor. A CSftTabsPage based dialog contains Windows controls and may optionally also include a tab control with nested CSftTabsPage objects attached to the tab control. CSftTabsPage is derived from CDialog. | Member | Description | | --- | --- | | [AllowDestroy](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabspage_allowdestroy) | Determines whether a page should be destroyed when it is no longer visible because the associated tab is no longer the currently active tab. | | [AllowSwitch](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabspage_allowswitch) | Determines whether a currently active page can be left and a new page activated. | | [ClosePossible](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabspage_closepossible) | Determines whether a page can be closed. | | [CSftTabsPage](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabspage_csfttabspage) | Standard constructor. | | [GetModified](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabspage_getmodified) | Returns the current data modification flag for the tabbed dialog. | | [GetParentDialog](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabspage_getparentdialog) | Returns the page's parent dialog object. | | [InitializeTabControl](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabspage_initializetabcontrol) | Initializes a tab control in a page. Activates the specified tab and the associated page. | | [m_flagDrawBackground](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabspage_m_flagdrawbackground) | Defines [background](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_background) handling for the tab page. | | [m_lpfnDrawBackground](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabspage_m_lpfndrawbackground) | Contains a pointer to the application supplied background handling callback for the tab page. | | [m_pTabCtl](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabspage_m_ptabctl) | Contains a pointer to the tab control object to which the page is attached. | | [m_UserDataBackground](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabspage_m_userdatabackground) | Defines an application defined value that is passed to the background drawing callback CSftTabsPage::m_lpfnDrawBackground as the *UserData* parameter. | | [OnCancel](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabspage_oncancel) | Called when the user clicks the Cancel button (the button with an ID of IDCANCEL). | | [OnOK](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabspage_onok) | Called when the user clicks the OK button (the button with an ID of IDOK). | | [SetClose](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabspage_setclose) | Signals that data has been changed permanently and the tabbed dialog can no longer be Cancel'ed. | | [SetModified](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabspage_setmodified) | Sets the current data modification flag for the tabbed dialog. | ### CSftTabsWindowSheet Class, Member Functions The class CSftTabsWindowSheet describes the support necessary for a tabbed, main window. A tabbed window is usually created dynamically using the CWnd::Create function. A tabbed window contains at least one tab control (CSftTabs based) and optionally other Windows controls. The class CSftTabsWindowSheet is used to add tabbed window support to most CWnd derived classes. This is accomplished using multiple inheritance. You supply the CWnd derived class, and through multiple inheritance, the class can then be used as a tabbed window, containing one or more tab controls with attached pages. | Member | Description | | --- | --- | | [ClosePossible](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabswindowsheet_closepossible) | Determines whether a tabbed window can be closed. | | [CSftTabsWindowSheet](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabswindowsheet_csfttabswindowsheet) | Standard constructor. | | [InitializeTabControl](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabswindowsheet_initializetabcontrol) | Initializes a tab control in a tabbed window. Activates the specified tab and the associated page. | | [TabSwitched](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabswindowsheet_tabswitched) | Handles the SFTTABSN_SWITCHED notification. | | [TabSwitching](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabswindowsheet_tabswitching) | Handles the SFTTABSN_SWITCHING notification. | | [TerminateTabControl](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabswindowsheet_terminatetabcontrol) | Terminates a tab control and deactivates all pages. | ### CSftTabsWindowPage Class, Member Functions The class CSftTabsWindowPage describes the support necessary for a window to be used as a page in a tabbed window. A CSftTabsWindowPage based window is typically created dynamically (at run-time) when the user switches to a tab. The class CSftTabsWindowPage is used to add support to most CWnd derived classes so they can be used as pages in a tabbed window. This is accomplished using multiple inheritance. You supply the CWnd derived class, and through multiple inheritance, the class can then be used as a page in a tabbed window. | Member | Description | | --- | --- | | [ActivatePage](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabswindowpage_activatepage) | Creates or activates a page. | | [AllowSwitch](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabswindowpage_allowswitch) | Determines whether a currently active page can be left and a new page activated. | | [CSftTabsWindowPage](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabswindowpage_csfttabswindowpage) | Standard constructor. | | [DeactivatePage](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabswindowpage_deactivatepage) | Deactivates or destroys a page | See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | Notifications ## ActivatePage *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_activatepage* Activates a page. C ``` BOOL WINAPI SftTabs_ActivatePage(HWND hwndParent, HWND hwndTabs, HWND hwndFrame, BOOL fInitializing); ``` ### Parameters hwndParent The window handle of the tab control's parent window. hwndTabs The window handle of the tab control. hwndFrame The window handle of a window to be used by SftTabs/DLL as [client area](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/pop_clientarea) 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](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_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](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/typedef_sfttabs_tabcallback), responsible for the [current tab](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/pop_activetab), to be called to create or initialize the new page. If a page is already active, [SftTabs_DeactivatePage](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_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](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## ActivatePage *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabswindowpage_activatepage* Creates or activates a page. C++ ``` protected: virtual BOOL CSftTabsWindowPage::ActivatePage(CWnd* pParent, CSftTabs* pTabCtl) = 0; ``` ### Parameters pParent The CWnd based object describing the tab control's parent window. pTabCtl A pointer to the tab control's [CSftTabs](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) based object. ### Returns If TRUE is returned, the page was successfully created and activated, otherwise FALSE is returned. ### Comments The ActivatePage function creates or activates a page. The CSftTabsWindowSheet class implementation calls this member function to Create the window associated with a page or to make the page visible. Your CWnd based class must implement ActivatePage. ### Example This example shows the suggested implementation of the ActivatePage function: ``` BOOL CYourPage::ActivatePage(CWnd* pParent, CSftTabs* pTabCtl) { // This is called when the user switches to a page if (!m_hWnd) { // The window doesn't exist, create it now. Make sure it's NOT VISIBLE // You can modify this to create another type of window instead. // The exact syntax of the Create function used depends on the base // class used. if (!Create(.... // Create the window WS_TABSTOP| // Tabstop style is important other_styles, CRect(0,0,0,0), // location pParent, // Parent Window a_control_id)) // control ID // make sure the above control ID does not collide with // IDs used by other pages or by the tab control itself return FALSE; // Additional initialization if desired } else { // The user switched back to this page } // This page is now active SftTabs_SetPageActive(m_hWnd, pTabCtl->m_hWnd, NULL); // Enable + show it, its size is 0,0,0,0, it will be resized by the tab control EnableWindow(TRUE); ShowWindow(SW_SHOW); return TRUE; } ``` See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | C++ Classes | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## AddTab *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_addtab* Adds a new tab to a tab control. The new tab will be added as the last tab. C ``` int SftTabs_AddTab(HWND hwndCtl, LPCTSTR lpszText); int SftTabs_AddTab_A(HWND hwndCtl, LPCSTR lpszText); int SftTabs_AddTab_W(HWND hwndCtl, LPCWSTR lpszText); ``` C++ ``` int CSftTabs::AddTab(LPCTSTR lpszText); ``` ### Parameters hwndCtl The window handle of the tab control. lpszText Points to the null-terminated string that is to be used as text for the tab label. ### Returns The return value is the zero-based index of the newly added tab. The return value is -1 if an error occurred or if the maximum number of tabs has been reached. ### Comments The AddTab function adds a new tab to a tab control. The new tab will be added as the last tab. The tab control creates a copy of the string supplied. The WM_SETREDRAW Windows message can be used to suppress the tab control from being redrawn when many tabs are added. Tabs can be deleted using [DeleteTab](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_deletetab). New tabs can be inserted at a specific location using [InsertTab](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_inserttab). ### Example C ``` index = SftTabs_AddTab(hwndTab, "A Test"); ``` C++ ``` index = m_Tab.AddTab("A Test"); ``` See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## AdjustClientRect *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_adjustclientrect* Calculates a tab control size which will provide a [client area](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/pop_clientarea) of the given size. C ``` BOOL SftTabs_AdjustClientRect(HWND hwndCtl, LPRECT lpRect); ``` C++ ``` BOOL CSftTabs::AdjustClientRect(LPRECT lpRect) const; ``` ### Parameters hwndCtl The window handle of the tab control. lpRect A pointer to a RECT structure containing the desired client area size. The values in the RECT structure will be updated to contain the required tab control size to accommodate the desired client area size. ### Returns The return value is TRUE if the function was successful, otherwise FALSE is returned. ### Comments The AdjustClientRect function calculates a tab control size which will provide a client area of the given size. This function can only be used with tab control styles that provide a client area (*fClientArea* of the [SFTTABS_CONTROL](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/struct_sfttabs_control) structure is TRUE). ### Example This example calculates the tab control size necessary to fit a client area size of 100 pixels in width and 50 pixels in height: C ``` RECT rect; SetRect(&rect, 0, 0, 100, 50); SftTabs_AdjustClientRect(hwndTab, &rect); ``` C++ ``` CRect rect(0,0,100,50); m_Tab.AdjustClientRect(&rect); ``` See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## Announce *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_announce* Pushes short application-status text to attached [screen readers](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_accessibility) through a UI Automation notification event. C ``` void SftTabs_Announce(HWND hwndCtl, LPCTSTR lpszText, DWORD flags); void WINAPI SftTabs_Announce_A(HWND hwndCtl, LPCSTR lpszText, DWORD flags); void WINAPI SftTabs_Announce_W(HWND hwndCtl, LPCWSTR lpszText, DWORD flags); ``` C++ ``` void CSftTabs::Announce(LPCTSTR lpszText, DWORD flags = SFTTABS_ANNOUNCE_INFO); ``` ### Parameters hwndCtl The window handle of the tab control. lpszText The text to announce. A short, complete phrase describing an application status change - for example "Saved", "Tab closed", "All tabs dirty", "Switched to page 3". The text should be something the user would want spoken, not a verbose log message. An empty or NULL string is silently ignored. flags Defines the kind of announcement and its delivery priority. *flags* combines one kind value and, optionally, the SFTTABS_ANNOUNCE_ASSERTIVE priority override. | | | | --- | --- | | SFTTABS_ANNOUNCE_INFO | Informational announcement, polite delivery. The assistive technology may dedup or drop the announcement if the user is currently interacting with other UI. This is the default. | | SFTTABS_ANNOUNCE_SUCCESS | An action has completed successfully. Polite delivery. | | SFTTABS_ANNOUNCE_WARNING | A notable but non-fatal situation the user should know about. Polite delivery. | | SFTTABS_ANNOUNCE_ERROR | An action has been aborted or has failed. Polite delivery. | | SFTTABS_ANNOUNCE_POLITE | Alias for SFTTABS_ANNOUNCE_INFO describing the default (polite / deduped) delivery mode. | | SFTTABS_ANNOUNCE_ASSERTIVE | Bit flag that can be combined with any of the kind values above (for example *SFTTABS_ANNOUNCE_ERROR \| SFTTABS_ANNOUNCE_ASSERTIVE*) to override the assistive technology's normal drop / dedup policy. The announcement will preempt any pending utterance. Use sparingly and only for information the user must hear. | ### Comments The Announce function pushes short application-status text to attached screen readers (Narrator, NVDA, JAWS, etc.) through a UI Automation notification event. The tab control itself does not render the text visually - Announce is a speech-only side channel intended for momentary status updates that would otherwise be invisible to users relying on assistive technologies. Typical uses: - confirming a destructive action ("Tab closed", "All changes discarded"), - reporting an operation result ("Saved", "Export complete"), - reporting state transitions ("Switched to page 3 of 5"), - reporting progress milestones for long-running operations. Announce has zero cost when no assistive technology is listening - the tab control queries UiaClientsAreListening before building the event and skips the call entirely otherwise. It is also a silent no-op on Windows versions earlier than Windows 10 version 1709 (build 16299), where UIA notification events are not supported. Empty or NULL text is likewise a no-op. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## AllowDestroy *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabspage_allowdestroy* Determines whether a page should be destroyed when it is no longer visible because the associated tab is no longer the currently [active tab](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/pop_activetab). C++ ``` virtual BOOL CSftTabsPage::AllowDestroy(); ``` ### Returns If TRUE is returned, the page will be destroyed, otherwise the page is disabled and hidden. ### Comments The AllowDestroy function determines whether a page should be destroyed when it is no longer visible because the associated tab is no longer the currently active tab. The default implementation of this member function returns FALSE after performing automatic data validation and exchange for the tabbed dialog. If FALSE is returned, a page and all its associated controls will not be destroyed which can cause considerable Windows resources to be allocated to these pages, however, the data stored in these controls will remain intact and can be accessed until the entire tabbed dialog is finally destroyed. It is up to the developer to weigh the benefits of data persistence against additional resource usage. Switching between tabs is also faster if pages aren't destroyed immediately because the pages don't have to be recreated from the dialog resources every time they become active. ### Example This example causes a page to be destroyed when the page is no longer the active page: ``` BOOL CSubPg6::AllowDestroy() // Allow window to be destroyed { return TRUE; } ``` See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## AllowSwitch *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabspage_allowswitch* Determines whether a currently active page can be left and a new page activated. C++ ``` virtual BOOL CSftTabsPage::AllowSwitch(); ``` ### Returns If TRUE is returned, the current page will be deactivated and another page will become active, otherwise the current page (and associated tab) cannot be changed. ### Comments The AllowSwitch function determines whether a currently active page can be left and a new page activated. The default implementation of this member function returns TRUE after performing automatic data validation and exchange for the page. An application can override this function to perform additional tests such as input validation, to determine if the page can be left. ### Example C++ ``` BOOL CAttrPage::AllowSwitch() { if (!UpdateData(TRUE)) return FALSE; CSampleDoc* pDoc = GetDocument(); pDoc->m_bottomMargin = m_BottomMargin; pDoc->m_leftMargin = m_LeftMargin; pDoc->m_rightMargin = m_RightMargin; pDoc->m_topMargin = m_TopMargin; return TRUE; } ``` See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## AllowSwitch *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabswindowpage_allowswitch* Determines whether a currently active page can be left and a new page activated. C++ ``` protected: virtual BOOL CSftTabsWindowPage::AllowSwitch(); ``` ### Returns If TRUE is returned, the current page will be deactivated and another page will become active, otherwise the current page (and associated tab) cannot be changed. ### Comments The AllowSwitch function determines whether a currently active page can be left and a new page activated. The default implementation of this member function returns TRUE. An application can override this function to perform additional tests such as input validation, to determine if the page can be left. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## ClosePossible *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_closepossible* The parent window of a tab control calls the SftTabs_ClosePossible function to test if a tabbed dialog or window can be ended. C ``` BOOL WINAPI SftTabs_ClosePossible(HWND hwndParent, HWND hwndTab); ``` ### Parameters hwndParent The window handle of the tab control's parent window. hwndTab The window handle of the tab control. ### Returns The return value is TRUE if the current page can be ended, otherwise the return value is FALSE. ### Comments The ClosePossible function is called by the parent window of a tab control to test if a tabbed dialog or window can be ended. SftTabs_ClosePossible is only used in the C implementation of tabbed dialogs and tabbed windows. The SftTabs_ClosePossible function sends [WM_QUERYENDSESSION](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_windows_messages) and [SftTabs_GetEndPageMessage](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_getendpagemessage) messages to the currently [active tab](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/pop_activetab) and its associated page, to determine whether the page can be deactivated. ### Example This C example shows the end of a typical tabbed dialog [WM_COMMAND](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) message handler: ``` case WM_COMMAND: { HWND hwndCtl = (HWND) lParam; int id = LOWORD(wParam); int code = HIWORD(wParam); if (hwndCtl) { switch (id) { case IDC_TAB: switch (code) { case SFTTABSN_SWITCHING:// we're about to switch away from // the current page. If you need to know what the new // page will be use SftTabs_GetNextTab(hwndCtl). if (!SftTabs_DeactivatePage(hwndParent, hwndCtl)) // couldn't deactivate current page, so don't switch SendMessage(hwndCtl, WM_CANCELMODE, 0, 0); break; case SFTTABSN_SWITCHED:// we switched to a new page SftTabs_ActivatePage(hwndParent, hwndCtl, NULL, FALSE); break; } break; case IDOK: case IDCANCEL: if (code == BN_CLICKED) SendMessage(hwndParent, WM_COMMAND, id, 0); break; } } else { switch (id) { case IDOK: // The currently active page will be called with a // WM_QUERYENDSESSION/SftTabs_GetEndPageMessage message to determine // whether it can be closed if (SftTabs_ClosePossible(hwndParent, GetDlgItem(hwndParent, IDC_TAB))) EndDialog(hwndParent, TRUE); break; case IDCANCEL: EndDialog(hwndParent, FALSE); break; // The above assumes that this is a modal dialog. If it is a modeless // don't use EndDialog, use DestroyWindow instead. } } break; } ``` See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | Notifications ## ClosePossible *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabsdialog_closepossible* Determines whether a tabbed dialog can be closed. C++ ``` virtual BOOL CSftTabsDialog::ClosePossible(); ``` ### Returns The return value is TRUE if the dialog can be closed, otherwise FALSE is returned. ### Comments The ClosePossible function determines whether a tabbed dialog can be closed. This function calls the [CSftTabsPage::AllowSwitch](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabspage_allowswitch) member function of the currently [active tab](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/pop_activetab) page. If the currently active page can be closed, the entire tabbed dialog can also be closed. An application can override this function to perform additional tests such as input validation, to determine if the dialog can be closed. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## ClosePossible *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabspage_closepossible* Determines whether a page can be closed. C++ ``` virtual BOOL CSftTabsPage::ClosePossible(); ``` ### Returns The return value is TRUE if the page can be closed, otherwise FALSE is returned. ### Comments The ClosePossible function determines whether a page can be closed. An application can override this function to perform additional tests such as input validation, to determine if the dialog can be closed. The default implementation also tests any nested tab controls and pages. The main dialog has to be tested using [CSftTabsDialog::ClosePossible](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabsdialog_closepossible). See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## ClosePossible *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabswindowsheet_closepossible* Determines whether a tabbed window can be closed. C++ ``` protected: virtual BOOL CSftTabsWindowSheet::ClosePossible(CWnd* pWnd, CSftTabs* pTabCtl); ``` ### Parameters pWnd The CWnd based object describing the tab control's parent window. pTabCtl A pointer to the tab control's [CSftTabs](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) based object. ### Returns The return value is TRUE if the window can be closed, otherwise FALSE is returned. ### Comments The ClosePossible function determines whether a tabbed window can be closed. This function calls the [CSftTabsWindowPage::AllowSwitch](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabswindowpage_allowswitch) member function of the currently [active tab](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/pop_activetab) page. If the currently active page can be closed, the entire tabbed window can also be closed. An application can override this function to perform additional tests such as input validation, to determine if the window can be closed. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | C++ Classes | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## CopyWindowTitle *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_copywindowtitle* Copies the window caption of a window to another window. C ``` void WINAPI SftTabs_CopyWindowTitle(HWND hwndFrom, HWND hwndTo); ``` ### Parameters hwndFrom The window handle of the window whose caption is to be copied to *hwndTo*. hwndTo The window handle of the window which is to receive the window caption copied from *hwndFrom*. ### Comments The CopyWindowTitle function copies the window caption of a window to another window. SftTabs_CopyWindowTitle is typically used in a [SFTTABS_TABCALLBACK](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/typedef_sfttabs_tabcallback) function to copy a page's caption to the enclosing dialog. If the window caption described by *hwndFrom* is an empty string, the caption of the window described by *hwndTo* is not changed. ### Example C ``` HWND CALLBACK Page1_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 for this page 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_PAGE1), hwndOwner, (DLGPROC)Page1_DialogProc, (LPARAM)hwndTab);// pass tab control as data // optional, set the main window's title to the window title defined for this page 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; } } } ``` See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## Create *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabs_create* Creates a tab control window and attaches it to the [CSftTabs object](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses). C++ ``` BOOL CSftTabs::Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID); ``` ### Parameters dwStyle Specifies the [window style](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_windowstyles) of the tab control. rect Specifies the tab control size and location. Can be a CRect object or a RECT structure. pParentWnd Specifies the tab control's parent window (usually a CDialog or a CView object). nID Specifies the tab control's ID. ### Returns The return value is TRUE if the function was successful, otherwise FALSE is returned. ### Comments The Create function creates a tab control window and attaches it to the CSftTabs object. A CSftTabs object is created in two steps. First the [CSftTabs constructor](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabs_csfttabs) is called, then the CSftTabs::Create member function, which initializes the tab control window and attaches it to the CSftTabs object. ### Example This example creates a tab control: C++ ``` CSftTabs Tab; Tab.Create(WS_CHILD|WS_VISIBLE|SFTTABSSTYLE_STANDARD_LEFT, CRect(250, 200, 400, 700), pParentWnd, IDC_TAB); ``` See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | C++ Classes | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## CSftTabs *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabs_csfttabs* Standard constructor. C++ ``` CSftTabs::CSftTabs(); ``` ### Comments A [CSftTabs object](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) is created in two steps. First the constructor CSftTabs is called, then the [CSftTabs::Create](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabs_create) member function, which initializes the tab control window and attaches it to the CSftTabs object. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | C++ Classes | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## CSftTabsDialog *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabsdialog_csfttabsdialog* Standard constructor. C++ ``` public: CSftTabsDialog::CSftTabsDialog(UINT IDD, CWnd* pParent = NULL); CSftTabsDialog::CSftTabsDialog(LPCTSTR lpszTemplate, CWnd* pParent = NULL); protected: CSftTabsDialog::CSftTabsDialog(); ``` ### Parameters IDD ID of the dialog resource used to create the dialog. lpszTemplate A null-terminated string containing the name of the dialog resource used to create the dialog. pParent A pointer to the parent window's CWnd based object. This parameter may be NULL if the tabbed dialog doesn't have a parent window. ### Comments A tabbed dialog is created in two steps. First, call the constructor [CSftTabsDialog](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses), then use DoModal to create a modal dialog or call [Create](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabs_create) to create a modeless tabbed dialog. Override the OnInitDialog member function to initialize the tab control and associate CSftTabsPage objects to tabs. ### Example This example invokes a modal tabbed dialog: ``` CMainDlg MainDlg; // tabbed dialog MainDlg.DoModal(); ``` See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | C++ Classes | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## CSftTabsPage *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabspage_csfttabspage* Standard constructor. C++ ``` public: CSftTabsPage::CSftTabsPage(UINT id, CWnd* pParent); CSftTabsPage::CSftTabsPage(LPCTSTR lpszResource, CWnd* pParent); ``` ### Parameters id ID of the dialog resource used to create the dialog. lpszResource A null-terminated string containing the name of the dialog resource used to create the dialog. pParent A pointer to the parent window's CWnd based object. This parameter may not be NULL. The parent window must be an object derived from [CSftTabsPage](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) or CSftTabsDialog. ### Comments A page attached to a tab control is created automatically by SftTabs/DLL in response to user input or under program control by calls such as [CSftTabsDialog::InitializeTabControl](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabsdialog_initializetabcontrol) or [SetCurrentTab](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_setcurrenttab). All pages created by SftTabs/DLL are created as modeless dialogs. ### Example This example creates several CSftTabsPage objects which are attached to the tab control: ``` BOOL CMainDlg::OnInitDialog() { int index; SFTTABS_TAB Tab; /* Associate the tab control created from the dialog */ /* resource with the C++ object. */ m_Tab.SubclassDlgItem(IDC_TAB, this /* parent window */); /* You could use DDX/DDV instead and add the following */ /* line to the DoDataExchange function of the tab */ /* control's parent window (remove the //). */ // DDX_Control(pDX, IDC_TAB, m_Tab); /* Initialization is faster if we set redraw off */ m_Tab.SetRedraw(FALSE); /* We are using new features */ m_Tab.SetVersion(SFTTABS_7_0); index = m_Tab.AddTab(_T("The First One")); m_Tab.SetToolTip(index, _T("Demonstrates tabbing into and out of the tab page")); Tab = Tab0; Tab.graph.item.hBitmap = (HBITMAP) m_SampleBitmap.m_hObject; m_Tab.SetTabInfo(index, &Tab); m_Tab.SetTabDialog(index, new CPage1(this)); /* tab page */ ... additional tab initialization ... index = m_Tab.AddTab(_T("Si&xth")); m_Tab.SetToolTip(index, _T("A page with nested tab controls and pages")); m_Tab.SetTabInfo(index, &Tab5); m_Tab.SetTabDialog(index, new CPage6(this)); /* tab page */ m_Tab.SetControlInfo(&CtlInit); // Make sure to turn redraw back on m_Tab.SetRedraw(TRUE); m_Tab.InvalidateRect(NULL, TRUE); // If you are not using the sheet/page classes, remove the ... // Initialize tab control InitializeTabControl(0, &m_Tab, NULL); return FALSE; // if this is a dialog's OnInitDialog member function } ``` See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | C++ Classes | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## CSftTabsWindowPage *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabswindowpage_csfttabswindowpage* Standard constructor. C++ ``` CSftTabsWindowPage::CSftTabsWindowPage(); ``` ### Comments The class [CSftTabsWindowPage](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) is never used by itself. It is used to add the support necessary to use a CWnd based class as a page. To avoid problems usually found with MFC and Windows messaging when using multiple inheritance, the class CSftTabsWindowPage must be defined as the "right-most" class. ### Example This example adds tabbed window support to the CSampleListBox class by using multiple inheritance: ``` class CSampleListBox : public CListBox, public CSftTabsWindowPage { ... class definition }; ``` See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | C++ Classes | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## CSftTabsWindowSheet *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabswindowsheet_csfttabswindowsheet* Standard constructor. C++ ``` CSftTabsWindowSheet::CSftTabsWindowSheet(); ``` ### Comments The class [CSftTabsWindowSheet](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) is never used by itself. It is used to add tabbed window support to a CWnd based class. To avoid problems usually found with MFC and Windows messaging when using multiple inheritance, the class CSftTabsWindowSheet must be defined as the "right-most" class. ### Example This example adds tabbed window support to the CSampleView class by using multiple inheritance: ``` class CSampleView : public CView, public CSftTabsWindowSheet { ... class definition }; ``` See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | C++ Classes | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## DarkMode *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_darkmode* Defines whether the tab control is rendered using a dark color palette. C ``` void WINAPI SftTabs_SetDarkMode(HWND hwndCtl, int mode); int WINAPI SftTabs_GetDarkMode(HWND hwndCtl); BOOL WINAPI SftTabs_IsDarkModeActive(HWND hwndCtl); ``` C++ ``` void CSftTabs::SetDarkMode(int mode); int CSftTabs::GetDarkMode() const; BOOL CSftTabs::IsDarkModeActive() const; ``` ### Parameters hwndCtl The window handle of the tab control. mode Defines the [dark mode](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_darkmode) setting. *mode* can be one of the following values: | | | | --- | --- | | SFTTABS_DARKMODE_OFF | The tab control is always rendered using the light color palette. This is the default. | | SFTTABS_DARKMODE_ON | The tab control is always rendered using the dark color palette, regardless of the Windows system setting. | | SFTTABS_DARKMODE_AUTO | The tab control follows the current Windows "Choose your mode" setting (Light / Dark) and switches automatically when the user changes the system setting. | ### Returns GetDarkMode returns a value indicating the current dark mode setting (SFTTABS_DARKMODE_OFF, SFTTABS_DARKMODE_ON or SFTTABS_DARKMODE_AUTO). IsDarkModeActive returns TRUE if the tab control is currently rendering with the dark color palette, otherwise FALSE. When *mode* is SFTTABS_DARKMODE_AUTO, the return value reflects the current Windows system setting. ### Comments The SetDarkMode, GetDarkMode and IsDarkModeActive functions define and retrieve a tab control's dark mode setting. Dark mode changes the palette used for the tab control's [background](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_background), tab labels, active-tab highlight, [scroll buttons](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/pop_scrollbutton) and close/minimize/restore buttons. [Windows themes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_using_themes) are suppressed while dark mode is active so the control renders through its built-in dark-aware GDI path rather than the system's light-themed tab style. When *mode* is SFTTABS_DARKMODE_AUTO, the tab control tracks WM_SETTINGCHANGE notifications from Windows and re-renders automatically when the user toggles the system Light / Dark setting. A SFTTABSN_DARKMODE_CHANGED notification is sent to the parent window each time the active mode flips so the application can repaint other UI to match. Caller-supplied color overrides set with [SetCtlColors](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_setctlcolors) and per-tab colors set in [SFTTABS_TAB](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/struct_sfttabs_tab) remain in effect in dark mode unless [high contrast mode](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_highcontrast) is also active. Owner-drawn tabs ([SFTTABS_DRAWTABPROC](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/typedef_sfttabs_drawtabproc)) must handle their own dark-mode compliance by reading the current palette from the [SFTTABS_DRAWINFO](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/struct_sfttabs_drawinfo) *colorBg* / *colorFg* members or by querying IsDarkModeActive. SetDarkMode is available on Windows 10 and later. On earlier platforms the setting is stored but has no visual effect. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## DeactivatePage *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_deactivatepage* The parent window of a tab control calls the SftTabs_DeactivatePage function to signal that the current page is no longer the active page. C ``` BOOL WINAPI SftTabs_DeactivatePage(HWND hwndParent, HWND hwndTab); ``` ### Parameters hwndParent The window handle of the tab control's parent window. hwndTab The window handle of the tab control. ### Returns The return value is TRUE if the current page was deactivated, otherwise the return value is FALSE. ### Comments The DeactivatePage function is called by the parent window of a tab control to signal that the current page is no longer the active page. SftTabs_DeactivatePage is only used in the C implementation of tabbed dialogs and tabbed windows. The SftTabs_DeactivatePage function sends a [WM_QUERYENDSESSION](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_windows_messages) and [SftTabs_GetEndPageMessage](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_getendpagemessage) messages to the currently [active tab](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/pop_activetab) and its associated dialog or window procedure to determine if the page can be deactivated. It also causes the tab callback routine [SFTTABS_TABCALLBACK](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/typedef_sfttabs_tabcallback) responsible for the current tab to be called to destroy the page. ### Example This C example shows a typical tabbed dialog [WM_COMMAND](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) message handler: ``` case WM_COMMAND: { HWND hwndCtl = (HWND) lParam; int id = LOWORD(wParam); int code = HIWORD(wParam); if (hwndCtl) { switch (id) { case IDC_TAB: switch (code) { case SFTTABSN_SWITCHING:// we're about to switch away from // the current page. If you need to know what the new // page will be use SftTabs_GetNextTab(hwndCtl). if (!SftTabs_DeactivatePage(hwndParent, hwndCtl)) // couldn't deactivate current page, so don't switch SendMessage(hwndCtl, WM_CANCELMODE, 0, 0); break; case SFTTABSN_SWITCHED:// we switched to a new page SftTabs_ActivatePage(hwndParent, hwndCtl, NULL, FALSE); break; } break; case IDOK: case IDCANCEL: if (code == BN_CLICKED) SendMessage(hwndParent, WM_COMMAND, id, 0); break; } } else { switch (id) { case IDOK: // The currently active page will be called with a // WM_QUERYENDSESSION/SftTabs_GetEndPageMessage message to determine // whether it can be closed if (SftTabs_ClosePossible(hwndParent, GetDlgItem(hwndParent, IDC_TAB))) EndDialog(hwndParent, TRUE); break; case IDCANCEL: EndDialog(hwndParent, FALSE); break; // The above assumes that this is a modal dialog. If it is a modeless // don't use EndDialog, use DestroyWindow instead. } } break; } ``` See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | Notifications ## DeactivatePage *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabswindowpage_deactivatepage* Deactivates or destroys a page. C++ ``` protected: virtual void CSftTabsWindowPage::DeactivatePage(CWnd* pParent, CSftTabs* pTabCtl, BOOL fFinal) = 0; ``` ### Parameters pParent The CWnd based object describing the tab control's parent window. pTabCtl A pointer to the tab control's [CSftTabs](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) based object. fFinal TRUE if the page must be destroyed or FALSE if the page can be hidden or destroyed. ### Comments The DeactivatePage function deactivates or destroys a page. The CSftTabsWindowSheet class implementation calls this member function to destroy the window associated with a page or to make the page invisible. If the page is destroyed, the page must be recreated when the user switches back to this page (see [CSftTabsWindowPage::ActivatePage](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabswindowpage_activatepage)). This does save resources but may cause excessive wait times. It is up to your application to choose the most suitable method. Not all CWnd derived classes are suitable to be destroyed multiple times while using the same C++ object. Some classes (once constructed) assume that an attached window is only created once, not multiple times as it could happen with SftTabs/DLL. If a class doesn't support multiple creation of its window, you have to use ShowWindow when the user switches away from the tab page (as shown in the example below). Your CWnd based class must implement DeactivatePage. ### Example This example shows the suggested implementation of the DeactivatePage function: ``` void CYourPage::DeactivatePage(CWnd* pParent, CSftTabs* pTabCtl, BOOL fFinal) { if (fFinal) { // You must destroy the window, the tabbed window (parent) is going away DestroyWindow(); } else { // Hide the page. If you want, you could use DestroyWindow here too. // In that case you save resources and the window will be recreated // when the user switches back to this page ShowWindow(SW_HIDE); EnableWindow(FALSE); } // clear associated page in tab's control structure SftTabs_SetPageInactive(pTabCtl->m_hWnd); } ``` See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | C++ Classes | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## DeleteTab *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_deletetab* Deletes a tab from the tab control. C ``` int SftTabs_DeleteTab(HWND hwndCtl, int iTab); ``` C++ ``` int CSftTabs::DeleteTab(int iTab); ``` ### Parameters hwndCtl The window handle of the tab control. iTab Specifies the zero-based index of the tab to be deleted. ### Returns The return value is the number of tabs remaining in the tab control. The return value is -1 if an error occurred. ### Comments The DeleteTab function deletes a tab from the tab control. The WM_SETREDRAW Windows message can be used to suppress the tab control from being redrawn when many tabs are deleted. Deleting an [active tab](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/pop_activetab) can cause unpredictable results. Switch to another tab first using [SetCurrentTab](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_setcurrenttab). ### Example This example deletes the tenth tab from the tab control: C ``` total = SftTabs_DeleteTab(hwndTab, 9); ``` C++ ``` total = m_Tab.DeleteTab(9); ``` See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## Destroy *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_destroy* The parent window of a tab control calls SftTabs_Destroy when the parent window is about to be destroyed. C ``` BOOL WINAPI SftTabs_Destroy(HWND hwndParent, HWND hwndTab); ``` ### Parameters hwndParent The window handle of the tab control's parent window. hwndTab The window handle of the tab control. ### Returns The return value is TRUE if the function was successful, otherwise FALSE is returned. ### Comments The Destroy function is called by the parent window of a tab control when the parent window is about to be destroyed. SftTabs_Destroy is only used in the C implementation of tabbed dialogs and tabbed windows. The SftTabs_Destroy function ends and destroys all pages that may still exist (even though not active) by calling the tab callback routines [SFTTABS_TABCALLBACK](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/typedef_sfttabs_tabcallback) responsible for each tab page. This C example shows a typical tabbed dialog WM_DESTROY message handler: ``` /* Unregister, or the window properties used won't be removed */ SftTabs_UnregisterDialog(hwndParent); /* destroy all pages */ SftTabs_Destroy(hwndParent, GetDlgItem(hwndParent, IDC_TAB)); ``` See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## DPI *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_dpi* Returns the effective DPI for the monitor the tab control is currently displayed on. C ``` int WINAPI SftTabs_GetDPI(HWND hwndCtl); ``` C++ ``` int CSftTabs::GetDPI() const; ``` ### Parameters hwndCtl The window handle of the tab control. ### Returns The return value is the effective DPI (dots-per-inch) for the monitor the tab control is currently displayed on. 96 represents 100% scaling, 120 represents 125%, 144 represents 150%, 192 represents 200%, and so on. If the host process is not [Per-Monitor DPI](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_dpi) aware, the return value is the System DPI and does not change for the lifetime of the process. ### Comments The GetDPI function returns the effective DPI for the monitor the tab control is currently displayed on. The tab control uses this value internally to scale tab heights, row heights, [scroll button](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/pop_scrollbutton) sizes, focus rectangle thickness, close/minimize/restore button sizes and 3D border widths via GetSystemMetricsForDpi and MulDiv. Applications that host SftTabs controls in a Per-Monitor v2 DPI-aware window receive a SFTTABSN_DPI_CHANGED notification whenever the window moves to a monitor of a different DPI, or the system DPI changes. In response, the application should re-send WM_SETFONT with a font sized for the new DPI (SftTabs does not own the application's font) and, if [SFTTABS_IMAGESCALING_ASIS](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_imagescaling) is in effect, re-register any caller-supplied tab pictures ([SFTTABS_TAB](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/struct_sfttabs_tab), TabPicture) at the new physical size. Callers that have opted into [SFTTABS_PIXELSCALING_STRETCH](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_pixelscaling) do not need to rescale dimensions such as *forcedSize*, *leftMargin*, *rightMargin* or *rowIndent* - the tab control handles those automatically. Callers that have opted into SFTTABS_IMAGESCALING_STRETCH do not need to re-register tab pictures at the new physical size. Owner-drawn tabs ([SFTTABS_DRAWTABPROC](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/typedef_sfttabs_drawtabproc)) receive the current DPI in [SFTTABS_DRAWINFO](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/struct_sfttabs_drawinfo)'s *dpi* field; owner-draw code should read the field on every paint and must not cache pixel metrics across callbacks. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## DrawSelectionOutline *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_drawselectionoutline* Draws a selection outline. C ``` void WINAPI SftTabs_DrawSelectionOutline(HWND hwndCtl, HDC hDC, LPCRECT lpRect, COLORREF OutlineBorder, COLORREF InnerBorder, COLORREF InnerFill1, COLORREF InnerFill2); ``` C++ ``` void CSftTabs::DrawSelectionOutline(HDC hDC, LPCRECT lpRect, COLORREF OutlineBorder, COLORREF InnerBorder, COLORREF InnerFill1, COLORREF InnerFill2) const; ``` ### Parameters hwndCtl The window handle of the tab control. hDC The device context handle, where the selection outline is to be rendered. lpRect The location and size of the selection outline. OutlineBorder The outermost border color used to render the rounded selection outline rectangle. InnerBorder The inner border color used to render the rounded selection outline rectangle. InnerFill1 The starting color (top) used to gradient fill the inside of the rounded selection outline rectangle. InnerFill2 The ending color (bottom) used to gradient fill the inside of the rounded selection outline rectangle. ### Comments The DrawSelectionOutline function draws a rounded selection outline rectangle. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## FreeGDIPlusImageLoadedFromFile *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_freegdiplusimageloadedfromfile* Deletes a [GDI+](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_gdiplus) image obtained using [SftTabs_LoadGDIPlusImageFromFile](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_loadgdiplusimagefromfile). C ``` void SftTabs_FreeGDIPlusImageLoadedFromFile(LPVOID pGDIPlusImage); ``` ### Parameters pGDIPlusImage A Gdiplus::Image pointer to be deleted. This value is usually obtained from a preceding call to SftTabs_LoadGDIPlusImageFromFile. ### Comments Deletes a GDI+ image obtained using SftTabs_LoadGDIPlusImageFromFile. This function is mainly intended for applications written [using C](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_usingc). Because Gdiplus is C++ based, C applications don't readily have access to the Gdiplus::Image class and cannot use delete to free a GDI+ image object. Using SftTabs_FreeGDIPlusImageLoadedFromFile even C applications can use GDI+ images, without needing access to GDI+ itself. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## FreeGDIPlusImageLoadedFromResource *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_freegdiplusimageloadedfromresource* Deletes a [GDI+](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_gdiplus) image obtained using [SftTabs_LoadGDIPlusImageFromResource](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_loadgdiplusimagefromresource). C ``` void SftTabs_FreeGDIPlusImageLoadedFromResource(LPVOID pGDIPlusImage); ``` ### Parameters pGDIPlusImage A Gdiplus::Image pointer to be deleted. This value is usually obtained from a preceding call to SftTabs_LoadGDIPlusImageFromResource. ### Comments Deletes a GDI+ image obtained using SftTabs_LoadGDIPlusImageFromResource. This function is mainly intended for applications written [using C](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_usingc). Because Gdiplus is C++ based, C applications don't readily have access to the Gdiplus::Image class and cannot use delete to free a GDI+ image object. Using SftTabs_FreeGDIPlusImageLoadedFromResource even C applications can use GDI+ images, without needing access to GDI+ itself. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## GDIPlusAvailable *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_gdiplusavailable* Returns whether [GDI+](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_gdiplus) support is available. C ``` BOOL WINAPI SftTabs_GetGDIPlusAvailable(HWND hwndCtl); ``` C++ ``` BOOL CSftTabs::GetGDIPlusAvailable() const; ``` ### Parameters hwndCtl The window handle of the tab control. ### Returns GetGDIPlusAvailable returns TRUE if GDI+ is available on the current system, otherwise FALSE is returned. ### Comments The GetGDIPlusAvailable function returns whether GDI+ support is available. In order to use GDI+ images (see [Sft_SetPictureGDIPlusImage](https://softelvdm.com/Documentation/SftPicture2/Topic/function_setpicturegdiplusimage)), GDI+ support must be available. For information about distributing GDI+ with your application, please see "[Distributing the Dlls](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_distributing)". See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## GetAllowAllInactive *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_getallowallinactive* Returns whether all tabs can become inactive. C ``` BOOL SftTabs_GetAllowAllInactive(HWND hwndCtl); ``` C++ ``` BOOL CSftTabs::GetAllowAllInactive() const; ``` ### Parameters hwndCtl The window handle of the tab control. ### Returns The return value is TRUE if [SetCurrentTab](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_setcurrenttab) and [SetCurrentTabEx](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_setcurrenttabex) can be used to deactivate all tabs. Otherwise FALSE is returned. ### Comments The GetAllowAllInactive function returns whether all tabs can become inactive. GetAllowAllInactive returns the value last defined using [SetAllowAllInactive](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_setallowallinactive). SetAllowAllInactive affects all subsequent calls to SetCurrentTab and SetCurrentTabEx. SetAllowAllInactive does not change the currently [active tab](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/pop_activetab), if any. ### Example C ``` BOOL fResult = SftTabs_GetAllowAllInactive(hwndTab); ``` C++ ``` BOOL fResult = m_Tab.GetAllowAllInactive(); ``` See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## GetControlInfo *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_getcontrolinfo* Retrieves tab control attributes. C ``` BOOL SftTabs_GetControlInfo(HWND hwndCtl, LPSFTTABS_CONTROL lpCtl); ``` C++ ``` BOOL CSftTabs::GetControlInfo(LPSFTTABS_CONTROL lpCtl) const; ``` ### Parameters hwndCtl The window handle of the tab control. lpCtl A pointer to a [SFTTABS_CONTROL](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/struct_sfttabs_control) structure. This structure will be updated with the [current tab](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/pop_activetab) control attributes. ### Returns The return value is TRUE if the function was successful, otherwise FALSE is returned. ### Comments The GetControlInfo function retrieves tab control attributes. Some of the structure values returned can be modified and updated using [SetControlInfo](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_setcontrolinfo). See SFTTABS_CONTROL for more information. ### Example C ``` SFTTABS_CONTROL Ctl; SftTabs_GetControlInfo(hwndTab, &Ctl); Ctl.nRows = 1; SftTabs_SetControlInfo(hwndTab, &Ctl); ``` C++ ``` SFTTABS_CONTROL Ctl; m_Tab.GetControlInfo(&Ctl); Ctl.nRows = 1; m_Tab.SetControlInfo(&Ctl); ``` See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## GetCount *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_getcount* Retrieves the number of tabs in a tab control. C ``` int SftTabs_GetCount(HWND hwndCtl); ``` C++ ``` int CSftTabs::GetCount() const; ``` ### Parameters hwndCtl The window handle of the tab control. ### Returns The return value is the number of tabs defined in the tab control. The return value is -1 if an error occurred. ### Comments The GetCount function retrieves the number of tabs in a tab control. ### Example This example retrieves the number of tabs: C ``` total = SftTabs_GetCount(hwndTab); ``` C++ ``` total = m_Tab.GetCount(); ``` See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## GetCtlColors *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_getctlcolors* Returns the tab control's color attributes. C ``` void SftTabs_GetCtlColors(HWND hwndCtl, LPSFTTABS_COLORS lpColors); ``` C++ ``` void CSftTabs::GetCtlColors(LPSFTTABS_COLORS lpColors) const; ``` ### Parameters hwndCtl The window handle of the tab control. lpColors A pointer to a [SFTTABS_COLORS](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/struct_sfttabs_colors) structure containing the color definitions. GetCtlColors uses this structure to return the current color settings. ### Comments The GetCtlColors function returns the tab control's color attributes. Using GetCtlColors and [SetCtlColors](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_setctlcolors) is the preferred method to change color attributes. Although a tab control generates [WM_CTLCOLORSTATIC](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_windows_messages) messages, the WM_CTLCOLORSTATIC message handling is provided for compatibility with SftTabs 2.0 only. When using [Windows themes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_using_themes), the colors are determined by the defined theme and defined colors are ignored. ### Example This example changes the tab control's foreground and [background](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_background) colors: C ``` SFTTABS_COLORS Colors; SftTabs_GetCtlColors(hwndTab, &Colors); /* Get current color settings */ Colors.colorBg = COLOR_WINDOW | 0x80000000L; /* Background color */ Colors.colorFg = RGB(0,0,128); /* Foreground color */ SftTabs_SetCtlColors(hwndTab, &Colors); /* Set new colors */ ``` C++ ``` SFTTABS_COLORS Colors; m_Tabs.GetCtlColors(&Colors); /* Get current color settings */ Colors.colorBg = COLOR_WINDOW | 0x80000000L; /* Background color */ Colors.colorFg = RGB(0,0,128); /* Foreground color */ m_Tabs.SetCtlColors(&Colors); /* Set new colors */ ``` See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## GetCurrentTab *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_getcurrenttab* Retrieves the index of the currently [active tab](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/pop_activetab). C ``` int SftTabs_GetCurrentTab(HWND hwndCtl); ``` C++ ``` int CSftTabs::GetCurrentTab() const; ``` ### Parameters hwndCtl The window handle of the tab control. ### Returns The return value is the index of the currently active tab. -1 is returned if no tab is active or if an error occurred. ### Comments The GetCurrentTab function retrieves the index of the currently active tab. The currently active tab can be set using [SetCurrentTab](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_setcurrenttab). It is possible for all tabs to be inactive (based on [SetAllowAllInactive](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_setallowallinactive)) in which case there is no current tab. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## GetDragInfo *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_getdraginfo* Returns the drag & drop information while handling [SFTTABSN_DRAGMOVE](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications)/SFTTABSN_DRAGDROP notifications. C ``` void SftTabs_GetDragInfo(HWND hwndCtl, LPSFTTABS_DRAGINFO lpDragInfo); ``` C++ ``` void CSftTabs::GetDragInfo(LPSFTTABS_DRAGINFO lpDragInfo) const; ``` ### Parameters hwndCtl The window handle of the tab control where tab reordering or drag & drop originated. lpDragInfo A pointer to a [SFTTABS_DRAGINFO](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/struct_sfttabs_draginfo) structure containing the drag & drop definitions. GetDragInfo uses this structure to return the current drag & drop information. ### Comments The GetDragInfo function returns the drag & drop information while handling SFTTABSN_DRAGMOVE/SFTTABSN_DRAGDROP notifications. GetDragInfo and [SetDragInfo](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_setdraginfo) can be used to disallow dragging to a target window (see SFTTABS_DRAGINFO, *targetAllowed*). See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | Notifications ## GetEndPageMessage *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_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 WINAPI 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](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_windows_messages). While WM_QUERYENDSESSION continues to be supported, an application can implement support for WM_QUERYENDSESSION or the private message defined by SftTabs_GetEndPageMessage. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## GetModified *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabsdialog_getmodified* Retrieves the current data modification flag for the tabbed dialog. C++ ``` virtual BOOL CSftTabsDialog::GetModified() const; ``` ### Returns The return value is TRUE if data has been modified, otherwise FALSE is returned. ### Comments The GetModified function retrieves the current data modification flag for the tabbed dialog. The maintenance of the data modification flag is up to the application. When input data is altered, the tabbed dialog or page should use [CSftTabsDialog::SetModified](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabsdialog_setmodified) or [CSftTabsPage::SetModified](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabspage_setmodified) to mark data as modified. There is only one data modification flag for a tabbed dialog. When using CSftTabsPage::SetModified (a page), the tabbed dialog's modification flag is updated, so a subsequent [CSftTabsPage::GetModified](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabspage_getmodified) (by another page attached to the same tab control) will return the value of the tabbed dialog's modification flag. An application could override the CSftTabsDialog::SetModified member function to visually notify the user that data has been modified. CSftTabsDialog::SetModified could be implemented to change the OK button's caption to "Save". See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## GetModified *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabspage_getmodified* Returns the current data modification flag for the tabbed dialog. C++ ``` virtual BOOL CSftTabsPage::GetModified() const; ``` ### Returns The return value is TRUE if data has been modified, otherwise FALSE is returned. ### Comments The GetModified function returns the current data modification flag for the tabbed dialog. The maintenance of the data modification flag is up to the application. When input data is altered, the tabbed dialog or page should use [CSftTabsDialog::SetModified](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabsdialog_setmodified) or [CSftTabsPage::SetModified](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabspage_setmodified) to mark data as modified. There is only one data modification flag for a tabbed dialog. When using CSftTabsPage::SetModified (a page), the tabbed dialog's modification flag is updated, so a subsequent CSftTabsPage::GetModified (by another page attached to the same tab control) will return the value of the tabbed dialog's modification flag. An application could override the CSftTabsDialog::SetModified member function to visually notify the user that data has been modified. CSftTabsDialog::SetModified could be implemented to change the OK button's caption to "Save". See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## GetNextTab *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_getnexttab* Retrieves the index of the next tab about to become active. C ``` int SftTabs_GetNextTab(HWND hwndCtl); ``` C++ ``` int CSftTabs::GetNextTab() const; ``` ### Parameters hwndCtl The window handle of the tab control. ### Returns The return value is the index of the next tab about to become active. ### Comments The GetNextTab function retrieves the index of the next tab about to become active. GetNextTab returns the index of the tab about to become active while processing a [SFTTABSN_SWITCHING](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) notification. The application can prevent the new tab from becoming active by sending a WM_CANCELMODE message to the tab control. GetNextTab can also be used in a [CSftTabsPage::AllowSwitch](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabspage_allowswitch) or [CSftTabsWindowPage::AllowSwitch](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabswindowpage_allowswitch) function, because these are called by the C++ class implementations while a SFTTABSN_SWITCHING notification is being processed. GetNextTab can only be used while processing a SFTTABSN_SWITCHING notification. ### Example This example prevents the user from switching to tab 0: C ``` case WM_COMMAND: { HWND hwndCtl = (HWND) lParam; int id = LOWORD(wParam); int code = HIWORD(wParam); if (hwndCtl) { switch (id) { case IDC_TAB: switch (code) { case SFTTABSN_SWITCHING:// we're about to switch away from // the current page. If you need to know what the new // page will be use SftTabs_GetNextTab(hwndCtl). if (SftTabs_GetNextTab(hwndCtl) == 0) { SendMessage(hwndCtl, WM_CANCELMODE, 0, 0); break; } if (!SftTabs_DeactivatePage(hwndParent, hwndCtl)) { // couldn't deactivate current page, so don't switch SendMessage(hwndCtl, WM_CANCELMODE, 0, 0); break; } break; case SFTTABSN_SWITCHED:// we switched to a new page SftTabs_ActivatePage(hwndParent, hwndCtl, NULL, FALSE); break; } break; } } break; } ``` C++ ``` BOOL CPage2::AllowSwitch() { if (m_pTabCtl->GetNextTab() == 0)) return FALSE; return TRUE; // Allow switching away from this page } ``` See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | Notifications ## GetParentDialog *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabspage_getparentdialog* Returns the page's parent dialog object. C++ ``` virtual CSftTabsDialog* CSftTabsPage::GetParentDialog() const; ``` ### Returns The return value is a pointer to the [CSftTabsDialog](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) based object which is the parent window of the page. ### Comments The GetParentDialog function returns the page's parent dialog object. GetParentDialog retrieves the top-most enclosing CSftTabsDialog based object in case of nested tab controls with attached pages. ### Example This example shows an OnOK member function of a CSftTabsPage based object. The page implements its own OK button. To process the OK button, it calls the parent dialog's OnOK member function. ``` void CPage4::OnOK() { // Send OK to parent GetParentDialog()->OnOK(); } ``` See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | C++ Classes | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## GetStyleTable *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_getstyletable* Returns a pointer to the style table. The style table describes all available tab styles, suitable for use by a resource editor. C ``` LPSFTTABS_STYLETABLEA WINAPI SftTabs_GetStyleTable(void); ``` ### Returns The return value is a pointer to the style table describing all available tab control styles. Each entry is of type [SFTTABS_STYLETABLEA](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/struct_sfttabs_styletablea). The *lpszDesc* member of the last entry in the table is NULL. ### Comments The GetStyleTable function returns a pointer to the style table. The style table describes all available tab styles, suitable for use by a resource editor. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## GetTabControlFromPage *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_gettabcontrolfrompage* Returns the tab control window handle, given the window handle of a window attached to a tab. C ``` HWND WINAPI SftTabs_GetTabControlFromPage(HWND hwndPage); ``` ### Parameters hwndPage The window handle of the window attached to a tab. ### Returns The return value is the window handle of the tab control if successful, otherwise NULL is returned. ### Comments The GetTabControlFromPage function returns the tab control window handle, given the window handle of a window attached to a tab. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## GetTabDialog *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabs_gettabdialog* Retrieves the [CSftTabsPage](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) based object attached to the specified tab. C++ ``` CSftTabsPage* CSftTabs::GetTabDialog(int iTab = -1) const; ``` ### Parameters iTab The zero-based index of the tab for which information is to be retrieved. If -1 is specified, the information for the currently [active tab](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/pop_activetab) is retrieved. ### Returns The return value is a pointer to the CSftTabsPage based object attached to the specified tab or NULL if no page is attached. The CSftTabsPage based object is set using [SetTabDialog](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabs_settabdialog). ### Comments The GetTabDialog function retrieves the CSftTabsPage based object attached to the specified tab. ### Example C++ ``` void CWizDlg::OnOK() { // Only close the dialog if current page says it's OK CSftTabsPage* pPage = m_Tab.GetTabDialog(m_Tab.GetCurrentTab()); ASSERT(pPage); if (pPage->AllowSwitch()) { CSftTabsDialog::OnOK(); } } ``` See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | C++ Classes | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## GetTabInfo *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_gettabinfo* Retrieves tab attributes. C ``` BOOL SftTabs_GetTabInfo(HWND hwndCtl, int iTab, LPSFTTABS_TAB lpTab); ``` C++ ``` BOOL CSftTabs::GetTabInfo(int iTab, LPSFTTABS_TAB lpTab) const; ``` ### Parameters hwndCtl The window handle of the tab control. iTab The zero-based index of the tab whose attributes are to be retrieved. lpTab A pointer to a [SFTTABS_TAB](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/struct_sfttabs_tab) structure. This structure will be updated with the specified tab's attributes. ### Returns The return value is TRUE if the function was successful, otherwise FALSE is returned. ### Comments The GetTabInfo function retrieves tab attributes. Some of the structure values returned can be modified and updated using [SetTabInfo](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_settabinfo). See SFTTABS_TAB for more information. ### Example This example retrieves the tab attributes for the third tab and modifies the [background](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_background) color: C ``` SFTTABS_TAB Tab; SftTabs_GetTabInfo(hwndTab, 2, &Tab); Tab.colorBg = RGB(255, 0, 0); SftTabs_SetTabInfo(hwndTab, 2, &Tab); ``` C++ ``` SFTTABS_TAB Tab; m_Tab.GetTabInfo(2, &Tab); Tab.colorBg = RGB(255, 0, 0); m_Tab.SetTabInfo(2, &Tab); ``` See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## GetTabLabel *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_gettablabel* Retrieves a tab's text. C ``` int SftTabs_GetTabLabel(HWND hwndCtl, int iTab, LPTSTR lpsz); int SftTabs_GetTabLabel_A(HWND hwndCtl, int iTab, LPSTR lpsz); int SftTabs_GetTabLabel_W(HWND hwndCtl, int iTab, LPWSTR lpsz); ``` C++ ``` int CSftTabs::GetTabLabel(int iTab, LPTSTR lpsz) const; void CSftTabs::GetTabLabel(int iTab, CString& string) const; ``` ### Parameters hwndCtl The window handle of the tab control. iTab The zero-based index of the tab for which information is to be retrieved. lpsz A pointer to a buffer where the tab's text will be returned. string A reference to a CString object, where the text will be returned. ### Returns The return value is the number of characters returned in the buffer, not including the terminating '\0'. The buffer must be large enough to receive the complete text. [GetTabLabelLen](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_gettablabellen) can be used to determine the buffer length needed. -1 is returned if an error occurred. ### Comments The GetTabLabel function retrieves a tab's text. A tab's text can be changed using [SetTabLabel](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_settablabel). ### Example This example retrieves the text of the second tab: C ``` TCHAR szBuffer[80]; SftTabs_GetTabLabel(hwndTab, 1, szBuffer); ``` C++ ``` CString str; m_Tab.GetTabLabel(1, str); TCHAR szBuffer[80]; m_Tab.GetTabLabel(1, szBuffer); ``` See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## GetTabLabelLen *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_gettablabellen* Retrieves the length of a tab's text. C ``` int SftTabs_GetTabLabelLen(HWND hwndCtl, int iTab); ``` C++ ``` int CSftTabs::GetTabLabelLen(int iTab) const; ``` ### Parameters hwndCtl The window handle of the tab control. iTab The zero-based index of the tab for which the text length is to be retrieved. ### Returns The return value is the length of the tab's text, not including the terminating '\0' or -1 if an error occurred. ### Comments The GetTabLabelLen function retrieves the length of a tab's text. When using UNICODE, the number returned is the number of wide characters, not the number of bytes. ### Example This example retrieves the length of the tenth tab's text: C ``` len = SftTabs_GetTabLabelLen (hwndTab, 9); ``` C++ ``` len = m_Tab.GetTabLabelLen(9); ``` See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## GetTabWindowPage *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabs_gettabwindowpage* Retrieves the [CSftTabsWindowPage](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) based object attached to the specified tab. C++ ``` CSftTabsWindowPage* CSftTabs::GetTabWindowPage(int iTab = -1) const; ``` ### Parameters iTab The zero-based index of the tab for which information is to be retrieved. If -1 is specified, the information for the currently [active tab](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/pop_activetab) is retrieved. ### Returns The return value is a pointer to the CSftTabsWindowPage based object attached to the specified tab or NULL if no page is attached. The CSftTabsWindowPage based object is set using [SetTabWindowPage](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabs_settabwindowpage). ### Comments The GetTabWindowPage function retrieves the CSftTabsWindowPage based object attached to the specified tab. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | C++ Classes | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## GetToolTip *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_gettooltip* Retrieves a tab's [ToolTip](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_tooltips) text. C ``` int SftTabs_GetToolTip(HWND hwndCtl, int iTab, LPTSTR lpsz); int SftTabs_GetToolTip_A(HWND hwndCtl, int iTab, LPSTR lpsz); int SftTabs_GetToolTip_W(HWND hwndCtl, int iTab, LPWSTR lpsz); ``` C++ ``` int CSftTabs::GetToolTip(int iTab, LPTSTR lpsz) const; void CSftTabs::GetToolTip(int iTab, CString& string) const; ``` ### Parameters hwndCtl The window handle of the tab control. iTab The zero-based index of the tab for which information is to be retrieved. lpsz A pointer to a buffer where the tab's ToolTip text will be returned. string A reference to a CString object, where the tab's ToolTip text will be returned. ### Returns The return value is the number of characters returned in the buffer, not including the terminating '\0'. The buffer must be large enough to receive the complete text. [GetToolTipLen](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_gettooltiplen) can be used to determine the buffer length needed. -1 is returned if an error occurred. ### Comments The GetToolTip function retrieves a tab's ToolTip text. A tab's ToolTip text can be changed using [SetToolTip](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_settooltip). ToolTips for the [scroll buttons](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/pop_scrollbutton), Minimize, Restore and Close buttons can be retrieved and defined using [GetControlInfo](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_getcontrolinfo) and [SetControlInfo](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_setcontrolinfo). ### Example This example retrieves the text of the second tab's ToolTip: C ``` TCHAR szBuffer[80]; SftTabs_GetToolTip(hwndTab, 1, szBuffer); ``` C++ ``` CString str; m_Tab.GetToolTip(1, str); ``` See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## GetToolTipHandle *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_gettooltiphandle* Returns the window handle of the [ToolTip](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_tooltips) control used by the tab control. C ``` HWND SftTabs_GetToolTipHandle(HWND hwndCtl); ``` ### Parameters hwndCtl The window handle of the tab control. ### Returns The return value is the window handle of the ToolTip control used by the tab control, or NULL if the tab control has not created a ToolTip control yet (for example, because ToolTips have not been enabled or none has been displayed). ### Comments The GetToolTipHandle function returns the window handle of the ToolTip control the tab control uses to display its ToolTips. An application can use the returned handle to send TTM_xxx messages to the ToolTip control to customize its appearance or behavior. The tab control owns the ToolTip control; the application must not destroy it or change its parent window. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## GetToolTipLen *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_gettooltiplen* Retrieves the length of a tab's [ToolTip](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_tooltips) text. C ``` int SftTabs_GetToolTipLen(HWND hwndCtl, int iTab); ``` C++ ``` int CSftTabs::GetToolTipLen(int iTab) const; ``` ### Parameters hwndCtl The window handle of the tab control. iTab The zero-based index of the tab for which the ToolTip text length is to be retrieved. ### Returns The return value is the length of the tab's ToolTip text, not including the terminating '\0' or -1 if an error occurred. ### Comments The GetToolTipLen function retrieves the length of a tab's ToolTip text. When using the UNICODE, the number returned is the number of wide characters, not the number of bytes. ### Example This example retrieves the length of the tenth tab's ToolTip text: C ``` len = SftTabs_GetToolTipLen(hwndTab, 9); ``` C++ ``` len = m_Tab.GetToolTipLen(9); ``` See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## GetVisibleCount *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_getvisiblecount* Retrieves the count of visible tabs. C ``` int SftTabs_GetVisibleCount(HWND hwndCtl); ``` C++ ``` int CSftTabs::GetVisibleCount() const; ``` ### Parameters hwndCtl The window handle of the tab control. ### Returns The return value is the count of visible tabs. The return value is -1 if an error occurred. ### Comments The GetVisibleCount function retrieves the count of visible tabs. A hidden tab is never displayed and can be defined using the [SFTTABS_TAB](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/struct_sfttabs_tab) structure, *fHidden* member. Its tab page is completely hidden also and the user cannot make the tab visible. Only the application can make a hidden tab visible. This is not equivalent to a tab that is currently not visible because the tab may have scrolled off the edge of the control. Hidden tabs are best used in situations where certain groups of users should not have access to all tabs of a tab control, without being aware that additional tabs may exist. ### Example This example retrieves the number of visible tabs: C ``` total = SftTabs_GetVisibleCount(hwndTab); ``` C++ ``` total = m_Tab.GetVisibleCount(); ``` See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## HandleDialogMessage *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_handledialogmessage* The parent dialog window of a tab control and the dialogs used as pages of a tab control call SftTabs_HandleDialogMessage to pass messages on to SftTabs/DLL so they can be processed. C ``` BOOL WINAPI SftTabs_HandleDialogMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); ``` ### Parameters hwnd The window handle of the destination window. msg Message ID. wParam, lParam Message parameters. ### Returns The return value is TRUE if the message was processed by SftTabs/DLL, otherwise FALSE. ### Comments The HandleDialogMessage function is called by the parent dialog window of a tab control and 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 accelerator keys, tab switching, ESCAPE and TAB key handling, etc. For windows (as opposed to dialogs) with tab controls, use the [SftTabs_HandleWindowMessage](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_handlewindowmessage) function instead. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## HandleWindowMessage *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_handlewindowmessage* The parent window of a tab control and the windows or dialogs used as pages of a tab control call SftTabs_HandleWindowMessage to pass messages on to SftTabs/DLL so they can be processed. C ``` BOOL WINAPI SftTabs_HandleWindowMessage(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam, LRESULT * lplResult); ``` ### Parameters hwnd The window handle of the destination window. message Message ID. wParam, lParam Message parameters. lplResult Pointer to an LRESULT value. This field will be set to the result of the processed message. ### Returns The return value is TRUE if the message was processed by SftTabs/DLL, otherwise FALSE. ### Comments The HandleWindowMessage function is called by the parent window of a tab control and the windows or 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 accelerator keys, tab switching, ESCAPE and TAB key handling, etc. For dialogs (as opposed to windows) with tab controls, use the [SftTabs_HandleDialogMessage](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_handledialogmessage) function instead. ### Example This C++ example handles unprocessed messages for a CView based window containing a tab control: ``` LRESULT CSampleView::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) { LRESULT lRes; if (SftTabs_HandleWindowMessage(m_hWnd, message, wParam, lParam, &lRes)) return lRes; // call base class return CView::WindowProc(message, wParam, lParam); } ``` See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## HighContrastMode *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_highcontrast* Defines whether the tab control honors the [Windows High Contrast](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_highcontrast) [accessibility](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_accessibility) setting. C ``` void WINAPI SftTabs_SetHighContrastMode(HWND hwndCtl, int mode); int WINAPI SftTabs_GetHighContrastMode(HWND hwndCtl); BOOL WINAPI SftTabs_IsHighContrastActive(HWND hwndCtl); ``` C++ ``` void CSftTabs::SetHighContrastMode(int mode); int CSftTabs::GetHighContrastMode() const; BOOL CSftTabs::IsHighContrastActive() const; ``` ### Parameters hwndCtl The window handle of the tab control. mode Defines the high contrast mode setting. *mode* can be one of the following values: | | | | --- | --- | | SFTTABS_HIGHCONTRAST_OFF | The tab control ignores the Windows High Contrast setting and renders normally, using the tab control's configured colors and themes. | | SFTTABS_HIGHCONTRAST_ON | The tab control always renders using the Windows system color palette (COLOR_WINDOW, COLOR_WINDOWTEXT, COLOR_HIGHLIGHT, etc.) as if Windows High Contrast were active. | | SFTTABS_HIGHCONTRAST_AUTO | The tab control follows the current Windows High Contrast accessibility setting and switches automatically when the user changes it. This is the default. | ### Returns GetHighContrastMode returns a value indicating the current high contrast mode setting (SFTTABS_HIGHCONTRAST_OFF, SFTTABS_HIGHCONTRAST_ON or SFTTABS_HIGHCONTRAST_AUTO). IsHighContrastActive returns TRUE if high contrast rendering is currently in effect on the tab control, otherwise FALSE. When *mode* is SFTTABS_HIGHCONTRAST_AUTO, the return value reflects the current Windows accessibility setting. ### Comments The SetHighContrastMode, GetHighContrastMode and IsHighContrastActive functions define and retrieve a tab control's high contrast mode setting. The default is SFTTABS_HIGHCONTRAST_AUTO so accessibility compliance is automatic; applications can opt out with SFTTABS_HIGHCONTRAST_OFF when a fully custom visual design is required. When high contrast rendering is active, caller-supplied color overrides set with [SetCtlColors](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_setctlcolors) and per-tab colors are ignored on the default render path. The control instead uses the matching Windows system color (COLOR_WINDOW for [backgrounds](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_background), COLOR_WINDOWTEXT for text, COLOR_HIGHLIGHT / COLOR_HIGHLIGHTTEXT for the [active tab](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/pop_activetab), etc.), complying with Microsoft's High Contrast guidance that the user's chosen contrast theme must not be overridden by the application. [Windows themes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_using_themes) are also suppressed in high contrast mode so the control falls back to the non-themed GDI path that honors system colors. When *mode* is SFTTABS_HIGHCONTRAST_AUTO, the tab control tracks WM_SETTINGCHANGE / SPI_SETHIGHCONTRAST notifications from Windows and re-renders automatically when the user toggles the accessibility setting. A SFTTABSN_HIGHCONTRAST_CHANGED notification is sent to the parent window each time the active state flips so the application can repaint other UI to match. Owner-drawn tabs ([SFTTABS_DRAWTABPROC](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/typedef_sfttabs_drawtabproc)) are responsible for their own high contrast compliance. The strict color remap described above applies only to the default render path; owner-draw code should query IsHighContrastActive and re-map its role colors to system-palette values when the return value is TRUE. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## HitTest *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_hittest* Determines the tab index of the tab at a given location. C ``` int SftTabs_HitTest(HWND hwndCtl, int x, int y); ``` C++ ``` int CSftTabs::HitTest(int x, int y) const; ``` ### Parameters hwndCtl The window handle of the tab control. x, y The horizontal (x) and vertical (y) position (in pixels), relative to the top, left corner of the tab control window, for which the zero-based tab index is to be determined. ### Returns The return value is the zero-based index of the tab at the given coordinates (x and y). The return value is -1 if no tab is at the given location. ### Comments The HitTest function determines the tab index of the tab at a given location. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## ImageScaling *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_imagescaling* Defines how images drawn by the tab control are scaled relative to the current monitor DPI. C ``` void WINAPI SftTabs_SetImageScaling(HWND hwndCtl, int mode); int WINAPI SftTabs_GetImageScaling(HWND hwndCtl); ``` C++ ``` void CSftTabs::SetImageScaling(int mode); int CSftTabs::GetImageScaling() const; ``` ### Parameters hwndCtl The window handle of the tab control. mode Defines the [image scaling](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_dpi) mode. *mode* can be one of the following values: | | | | --- | --- | | SFTTABS_IMAGESCALING_ASIS | Every image is drawn at its native pixel size, regardless of the current monitor DPI. This is the default and preserves the traditional SftTabs/DLL behavior. On high-DPI monitors, images supplied at 96 DPI appear physically smaller than the surrounding text. | | SFTTABS_IMAGESCALING_STRETCH | Every image is scaled by the factor *currentDPI / 96* when drawn. On a 150% DPI monitor, a 16-pixel-tall image is drawn 24 pixels tall; on a 200% monitor it is drawn 32 pixels tall. Bitmap images use StretchBlt with HALFTONE mode; [GDI+](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_gdiplus) images use InterpolationModeHighQualityBicubic. | ### Returns GetImageScaling returns a value indicating the current image scaling mode (SFTTABS_IMAGESCALING_ASIS or SFTTABS_IMAGESCALING_STRETCH). ### Comments The SetImageScaling and GetImageScaling functions define how images drawn by the tab control are scaled relative to the current monitor DPI. The setting applies to every image the control draws: - caller-supplied tab pictures ([SFTTABS_TAB](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/struct_sfttabs_tab), TabPicture and TabPicture2, including hot and disabled variants), - caller-supplied [scroll button](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/pop_scrollbutton) and close/minimize/restore button bitmaps ([SFTTABS_CONTROL](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/struct_sfttabs_control), hButtonBitmap, hButtonBitmap2, and their disabled counterparts). SetImageScaling is independent of [SetPixelScaling](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_pixelscaling). SetImageScaling controls the size at which images are drawn; SetPixelScaling controls how caller-supplied pixel dimensions (margins, indentation, forced tab size, etc.) are interpreted. Either can be used without the other. SFTTABS_IMAGESCALING_ASIS (the default) preserves back-compatible behavior - applications that already supply DPI-appropriate images (or that only target 96 DPI) do not need to change anything. SFTTABS_IMAGESCALING_STRETCH is the simplest way to make an existing application look correct on high-DPI monitors without shipping multiple image sizes, at the cost of some visual softness from the stretch filter. For best image quality at high DPI, supply higher-resolution master images and leave the mode at SFTTABS_IMAGESCALING_ASIS. When the control is hosted on a Per-Monitor v2 DPI-aware window, the control re-renders automatically on DPI change. Callers who have opted into SFTTABS_IMAGESCALING_STRETCH do not need to re-register images in response to [SFTTABSN_DPI_CHANGED](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_dpi). See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## InitializeTabControl *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabsdialog_initializetabcontrol* Initializes a tab control in a tabbed dialog. Activates the specified tab and the associated page. C++ ``` BOOL CSftTabsDialog::InitializeTabControl(int iTab, CSftTabs* pTabCtl, CWnd* pFrame = NULL); ``` ### Parameters iTab The zero-based index of the tab to be made the [active tab](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/pop_activetab). pTabCtl A pointer to the tab control's [CSftTabs](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) based object. pFrame A pointer to a window's CWnd based object. This window will be used by SftTabs/DLL as [client area](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/pop_clientarea) for pages attached to the tab control. SftTabs/DLL uses this window's client area size and location as a replacement for the tab control's client area. The window described by *pFrame* 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](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_resizepages) function. Using this frame window, the client area of a tab control can be located anywhere in relation to the tab control even on a different dialog or window. This parameter may be NULL, in which case the tab control's client area is used for attached pages. ### Returns The return value is TRUE if the function was successful, otherwise FALSE is returned. ### Comments The InitializeTabControl function initializes a tab control in a tabbed dialog. Activates the specified tab and the associated page. A tabbed dialog's tab control has to be initialized, which creates the page attached to the currently active tab. This is typically done in the OnInitDialog member function of the tabbed dialog. When a tabbed dialog is destroyed, all attached CSftTabsPage objects are automatically destroyed and deleted (using the C++ delete operator). ### Example This example initializes the tab control of a tabbed dialog and activates the second tab: ``` ///////////////////////////////////////////////////////////////////////////// // CMainDlg message handlers BOOL CMainDlg::OnInitDialog() { // call base class CSftTabsDialog::OnInitDialog(); int index; /* Associate the tab control created from the dialog */ /* resource with the C++ object. */ m_Tab.SubclassDlgItem(IDC_TAB, this /* parent window */); /* Initialization is faster if we set redraw off */ m_Tab.SetRedraw(FALSE); /* We are using new features */ m_Tab.SetVersion(SFTTABS_7_0); ... additional tab initialization ... index = m_Tab.AddTab(_T("&Six")); m_Tab.SetTabInfo(index, &Tab5); // If you don't want to attach a page to the tab, the following is optional // m_Tab.SetTabDialog(index, new an_object_based_on_CSftTabsPage(this)); // tab page m_Tab.SetControlInfo(&CtlInit); // Make sure to turn redraw back on m_Tab.SetRedraw(TRUE); m_Tab.InvalidateRect(NULL, TRUE); // If you are not using the sheet/page classes, remove the ... // Initialize tab control InitializeTabControl(1, &m_Tab, NULL); return FALSE; ``` See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | C++ Classes | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## InitializeTabControl *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabspage_initializetabcontrol* Initializes a tab control in a page. Activates the specified tab and the associated page. C++ ``` BOOL CSftTabsPage::InitializeTabControl(int iTab, CSftTabs* pTabCtl, CWnd* pFrame = NULL); ``` ### Parameters iTab The zero-based index of the tab to be made the [active tab](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/pop_activetab). pTabCtl A pointer to the tab control's [CSftTabs](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) based object. pFrame A pointer to a window's CWnd based object. This window will be used by SftTabs/DLL as [client area](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/pop_clientarea) for pages attached to the tab control. SftTabs/DLL uses this window's client area size and location as a replacement for the tab control's client area. The window described by *pFrame* 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](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_resizepages) function. Using this frame window, the client area of a tab control can be located anywhere in relation to the tab control even on a different dialog or window. This parameter may be NULL, in which case the tab control's client area is used for attached pages. ### Returns The return value is TRUE if the function was successful, otherwise FALSE is returned. ### Comments The InitializeTabControl function initializes a tab control in a page. Activates the specified tab and the associated page. A page's tab control has to be initialized, which creates the page attached to the currently active tab. This is typically done in the OnInitDialog member function of the page. This function is only used for pages which contain tab controls. A main tabbed dialog would use [CSftTabsDialog::InitializeTabControl](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabsdialog_initializetabcontrol) instead. When a tabbed dialog is destroyed, all attached CSftTabsPage objects are automatically destroyed and deleted (using the C++ delete operator). ### Example This example initializes the tab control of a page and activates the second tab: ``` ///////////////////////////////////////////////////////////////////////////// // CPageDlg message handlers BOOL CPageDlg::OnInitDialog() { // call base class CSftTabsPage::OnInitDialog(); int index; SFTTABS_TAB Tab; // Attach the tab control window to the CSftTabs object m_Tab1.SubclassDlgItem(IDC_P6_TAB1, this /* parent window */); ... additional tab initialization ... index = m_Tab.AddTab(_T("Si&xth")); m_Tab.SetTabInfo(index, &Tab5); m_Tab.SetTabDialog(index, new CPage6(this));/* tab page */ m_Tab.SetControlInfo(&CtlInit); // Initialize tab control InitializeTabControl(1, &m_Tab, NULL); return FALSE; } ``` See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | C++ Classes | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## InitializeTabControl *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabswindowsheet_initializetabcontrol* Initializes a tab control in a tabbed window. Activates the specified tab and the associated page. C++ ``` protected: BOOL CSftTabsWindowSheet::InitializeTabControl(CWnd* pWnd, int iTab, CSftTabs* pTabCtl, CWnd* pFrame = NULL); ``` ### Parameters pWnd The CWnd based object describing the tab control's parent window. iTab The zero-based index of the tab to be made the [active tab](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/pop_activetab). pTabCtl A pointer to the tab control's [CSftTabs](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) based object. pFrame A pointer to a window's CWnd based object. This window will be used by SftTabs/DLL as [client area](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/pop_clientarea) for pages attached to the tab control. SftTabs/DLL uses this window's client area size and location as a replacement for the tab control's client area. The window described by *pFrame* 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](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_resizepages) function. Using this frame window, the client area of a tab control can be located anywhere in relation to the tab control even on a different dialog or window. This parameter may be NULL, in which case the tab control's client area is used for attached pages. ### Returns The return value is TRUE if the function was successful, otherwise FALSE is returned. ### Comments The InitializeTabControl function initializes a tab control in a tabbed window. Activates the specified tab and the associated page. A tabbed window's tab control has to be initialized, which creates the page attached to the currently active tab. This is typically done in the OnCreate member function of the tabbed window. When a tabbed window is destroyed, all attached CSftTabsWindowPage objects are automatically destroyed. However, any dynamically allocated CSftTabsWindowPage derived objects must be deleted (using the C++ delete operator) by the application. ### Example This example initializes the tab control of a tabbed window and activates the first tab: ``` int CSampleView::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CView::OnCreate(lpCreateStruct) == -1) return -1; // Create a static control that we can place above the tab control. // This is just used to cover the parent window in that area. if (!m_Gap.Create(_T(""), SS_SIMPLE | WS_VISIBLE | WS_CHILD, CRect(0, 0, 0, 0), /* position */ this)) return -1; #if !defined(TAB_CONTROL_WITH_CLIENTAREA) // Create a static control that we can use as a frame window for the tab control's // pages. This window is not visible and is just used to indicate the page position if (!m_Frame.Create(_T(""), SS_SIMPLE | WS_CHILD, CRect(0, 0, 0, 0), /* position */ this)) return -1; #endif // Create the tab control if (!m_Tab.Create( WS_VISIBLE | WS_CHILD | /* Visible, child window */ WS_CLIPCHILDREN | WS_TABSTOP | /* Clip child windows, tabstop */ WS_GROUP, /* Group */ CRect(0, 0, 0, 0), /* position */ this, /* Parent window */ IDC_TAB)) /* tab control ID */ return -1; int index; /* Initialization is faster if we set redraw off */ m_Tab.SetRedraw(FALSE); /* Create the font used for the tab control. */ /* Fonts are owned by the application and have to remain */ /* valid as long as the tab control uses the font. */ int height; /* Height in pixels */ HDC hDC; /* Device context */ /* Create the font to be used for the tab control. */ hDC = ::GetDC(NULL); /* Get a device context */ height = MulDiv(12, ::GetDeviceCaps(hDC, LOGPIXELSY), 72);/* Convert ... m_Font.CreateFont(-height, 0, 0, 0, FW_NORMAL, 0, 0, 0, 0, 0, 0, 0, 0, _T("Arial")); ::ReleaseDC(NULL, hDC); /* Release device context */ m_Tab.SetFont(&m_Font, FALSE); /* Set tab control font */ /* We are using new features */ m_Tab.SetVersion(SFTTABS_7_0); index = m_Tab.AddTab(_T("&Listbox")); m_Tab.SetToolTip(index, _T("ToolTip for the ListBox tab")); m_Tab.SetTabInfo(index, &Tab0); m_Tab.SetTabWindowPage(index, &m_ListBox); /* tab page */ index = m_Tab.AddTab(_T("&Edit Control")); m_Tab.SetTabInfo(index, &Tab1); m_Tab.SetTabWindowPage(index, &m_Edit); /* tab page */ index = m_Tab.AddTab(_T("&Other Listbox")); m_Tab.SetToolTip(index, _T("ToolTip for the Other ListBox tab")); m_Tab.SetTabInfo(index, &Tab2); m_Tab.SetTabWindowPage(index, &m_OtherListBox); /* tab page */ m_Tab.SetControlInfo(&CtlInit); // Make sure to turn redraw back on m_Tab.SetRedraw(TRUE); m_Tab.InvalidateRect(NULL, TRUE); #if defined(TAB_CONTROL_WITH_CLIENTAREA) // Initialize tab control InitializeTabControl(this, 0, &m_Tab, NULL); #else // Initialize tab control. An invisible, disabled frame window is used to ... InitializeTabControl(this, 0, &m_Tab, &m_Frame); #endif // Mark the view as a main, tabbed window (so accel. keys work) by registering it. SftTabs_RegisterWindow(m_hWnd); return 0; } ``` See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | C++ Classes | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## InsertTab *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_inserttab* Inserts a new tab at the specified position. C ``` int SftTabs_InsertTab(HWND hwndCtl, int iTab, LPCTSTR lpszText); int SftTabs_InsertTab_A(HWND hwndCtl, int iTab, LPCSTR lpszText); int SftTabs_InsertTab_W(HWND hwndCtl, int iTab, LPCWSTR lpszText); ``` C++ ``` int CSftTabs::InsertTab(int iTab, LPCTSTR lpszText); ``` ### Parameters hwndCtl The window handle of the tab control. iTab The zero-based index of the tab to be added. If -1 is specified, the tab will be added at the end. lpszText A pointer to the null-terminated string that is to be used as text for the tab label. ### Returns The return value is the zero-based index of the newly added tab. The return value is -1 if an error occurred or if the maximum number of tabs has been reached. ### Comments The InsertTab function inserts a new tab at the specified position. The tab control creates a copy of the string supplied. The WM_SETREDRAW Windows message can be used to suppress the tab control from being redrawn when many tabs are added. Tabs can be deleted using [DeleteTab](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_deletetab). Tabs can be added using [AddTab](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_addtab). ### Example This example inserts a tab with the tab text "A Test" at the third position: C ``` index = SftTabs_InsertTab(hwndTab, 2, "A Test"); ``` C++ ``` index = m_Tab.InsertTab(2, "A Test"); ``` See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## IsHiRes *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_ishires* Returns whether high resolution support is enabled. C ``` BOOL WINAPI SftTabs_IsHiRes(); ``` ### Returns The return value is TRUE if the current application has high resolution support enabled, otherwise FALSE is returned. ### Comments > Discontinued. This function was only relevant in the discontinued Windows Mobile environment. It always returns FALSE. The IsHiRes function returns whether high resolution support is enabled. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## IsRegisteredDialog / -Window *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_isregistereddialog* Determines whether a given window or dialog is registered with SftTabs/DLL for special tabbed dialog or tabbed window handling, such as accelerator key handling, ESCAPE and TAB key processing, etc. C ``` BOOL WINAPI SftTabs_IsRegisteredDialog(HWND hwndDialog); BOOL WINAPI SftTabs_IsRegisteredWindow(HWND hwndWnd); ``` ### Parameters hwndDialog, hwndWnd The window handle of the dialog or window to be tested. ### Returns The return value is TRUE if the window is registered with SftTabs/DLL for special tabbed dialog or window handling, otherwise FALSE is returned. ### Comments The IsRegisteredDialog function determines whether a given window or dialog is registered with SftTabs/DLL for special tabbed dialog or tabbed window handling, such as accelerator key handling, ESCAPE and TAB key processing, etc. A main tabbed dialog or window containing a tab control is registered using [SftTabs_RegisterWindow](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_registerdialog) or SftTabs_RegisterDialog. Windows and dialogs based on the C++ class [CSftTabsDialog](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) are automatically registered. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | C++ Classes | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## IsTabControl *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_istabcontrol* Determines whether a given window is a tab control. C ``` BOOL WINAPI SftTabs_IsTabControl(HWND hwndCtl); ``` ### Parameters hwndCtl The window handle of the window to be tested. ### Returns The return value is TRUE if the window is a tab control, otherwise FALSE is returned. ### Comments The IsTabControl function determines whether a given window is a tab control. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## IsTabControlWithDialog *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_istabcontrolwithdialog* Determines whether a given window is a tab control with an attached page. C ``` BOOL WINAPI SftTabs_IsTabControlWithDialog(HWND hwndCtl); BOOL WINAPI SftTabs_IsTabControlWithPage(HWND hwndCtl); ``` ### Parameters hwndCtl The window handle of the window to be tested. ### Returns The return value is TRUE if the window *hwndCtl* is a tab control with an attached page (*hwndSubDlg* in [SFTTABS_CONTROL](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/struct_sfttabs_control) is not NULL), otherwise FALSE is returned. ### Comments The IsTabControlWithDialog function determines whether a given window is a tab control with an attached page. SftTabs_IsTabControlWithPage is a synonym for SftTabs_IsTabControlWithDialog and works the same way for tab controls in a tabbed dialog or a tabbed window. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## LoadGDIPlusImageFromFile *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_loadgdiplusimagefromfile* Loads a [GDI+](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_gdiplus) image from a file. C ``` LPVOID SftTabs_LoadGDIPlusImageFromFile(LPCTSTR lpszFilename); ``` ### Parameters lpszFilename The fully-qualified path of the image file to be loaded. GDI+ supports common image formats including BMP, JPEG, GIF, PNG, and TIFF. ### Returns If successful, the return value is a Gdiplus::Image pointer or NULL if the function failed. ### Comments Loads a GDI+ image from a file. This function is mainly intended for applications written [using C](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_usingc). Because Gdiplus is C++ based, C applications don't readily have access to the Gdiplus::Image class and cannot use Bitmap::FromFile to load a GDI+ image. Using SftTabs_LoadGDIPlusImageFromFile even C applications can use GDI+ images, without needing access to GDI+ itself. The application retains ownership of the Gdiplus::Image pointer returned by SftTabs_LoadGDIPlusImageFromFile. Once the image is no longer needed, it can be released using [SftTabs_FreeGDIPlusImageLoadedFromFile](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_freegdiplusimageloadedfromfile), which frees the associated memory. LoadGDIPlusImageFromFile provides essentially the same service as the GDI+ Bitmap::FromFile function. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## LoadGDIPlusImageFromResource *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_loadgdiplusimagefromresource* Loads a [GDI+](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_gdiplus) image from an application's or DLL's resources. C ``` LPVOID SftTabs_LoadGDIPlusImageFromResource(HMODULE hInst, LPCTSTR lpszResourceType, LPCTSTR lpszResourceName); ``` ### Parameters hInst The instance handle of the application or DLL containing the resource. lpszResourceType The resource type. Can be a string or an identifier using the MAKEINTRESOURCE macro. lpszResourceName The resource name. Can be a string or an identifier using the MAKEINTRESOURCE macro. ### Returns If successful, the return value is a Gdiplus::Image pointer or NULL if the function failed. ### Comments Loads a GDI+ image from an application's or DLL's resources. This function is mainly intended for applications written [using C](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_usingc). Because Gdiplus is C++ based, C applications don't readily have access to the Gdiplus::Image class and cannot use Bitmap::FromResource to load a GDI+ image. Using SftTabs_LoadGDIPlusImageFromResource even C applications can use GDI+ images, without needing access to GDI+ itself. The application retains ownership of the Gdiplus::Image pointer returned by SftTabs_LoadGDIPlusImageFromResource. Once the image is no longer needed, it can be released using [SftTabs_FreeGDIPlusImageLoadedFromResource](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_freegdiplusimageloadedfromresource), which frees the associated memory. LoadGDIPlusImageFromResource provides essentially the same service as the GDI+ Bitmap::FromResource function. Please note that GDI+ images cannot be defined as BITMAP resources. They must be included as custom resources. The Images sample demonstrates how this is accomplished. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## m_fInitializing *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabsdialog_m_finitializing* Defines the current initialization status. C++ ``` protected: BOOL CSftTabsDialog::m_fInitializing; ``` ### Comments The m_fInitializing member defines the current initialization status. m_fInitializing is set to TRUE while the tabbed dialog is initializing, typically while the WM_INITDIALOG message is being handled. Once the tabbed dialog is fully initialized, it is set to FALSE. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## m_flagDrawBackground *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabspage_m_flagdrawbackground* Defines [background](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_background) handling for the tab page. C++ ``` DWORD CSftTabsPage::m_flagDrawBackground; ``` ### Comments The m_flagDrawBackground member defines background handling for the tab page. m_flagDrawBackground defines background handling for the tab page, using one of the following values: | | | | --- | --- | | 0 | [CSftTabsPage::m_lpfnDrawBackground](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabspage_m_lpfndrawbackground) is ignored if [Windows themes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_using_themes) are active. | | SFTTABS_DRAWBG_OVERRIDETHEME | CSftTabsPage::m_lpfnDrawBackground is always honored, even if Windows themes are active. | When [using C](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_usingc), the [SftTabs_TransparentControls](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_transparentcontrols) function handles background painting. > Backgrounds require Common Controls version 6. Background colors based on [SFTTABS_TAB](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/struct_sfttabs_tab), * colorClientArea* are supported in all environments. ### Example This example paints a custom tab page background by filling the tab page with a tiled bitmap. C++ ``` CSamplePage::CSamplePage(CWnd* pParent /*=NULL*/) : CSftTabsPage(CSamplePage::IDD, pParent) { m_lpfnDrawBackground = SamplePage_DrawBackground; m_flagDrawBackground = SFTTABS_DRAWBG_OVERRIDETHEME; m_UserDataBackground = (SFTTABS_DWORD_PTR)this; m_BackgroundBitmap.LoadBitmap(IDB_BACKGROUND); } void CALLBACK SamplePage_DrawBackground(HDC hDC, HWND hwndDlg, HWND hwndTab, SFTTABS_DWORD_PTR UserData) { CSamplePage* pThis = (CSamplePage*)UserData; RECT rect; GetClientRect(hwndDlg, &rect); SftTabs_PaintTiledBitmap(hDC, pThis->m_BackgroundBitmap, 0, 0, &rect); } ``` See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## m_fModified *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabsdialog_m_fmodified* Defines the current data modification status. C++ ``` protected: BOOL CSftTabsDialog::m_fModified; ``` ### Comments The m_fModified member defines the current data modification status. m_fModified returns the current data modification status maintained for the tabbed dialog. This member should only be used by derived classes. Otherwise, the [CSftTabsDialog::GetModified](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabsdialog_getmodified)() function should be used instead. The maintenance of the data modification flag is up to the application. When input data is altered, the tabbed dialog or page should use [CSftTabsDialog::SetModified](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabsdialog_setmodified) or [CSftTabsPage::SetModified](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabspage_setmodified) to mark data as modified. There is only one data modification flag for a tabbed dialog. When using CSftTabsPage::SetModified (a page), the tabbed dialog's modification flag is updated, so a subsequent [CSftTabsPage::GetModified](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabspage_getmodified) (by another page attached to the same tab control) will return the value of the tabbed dialog's modification flag. An application could override the CSftTabsDialog::SetModified member function to visually notify the user that data has been modified. CSftTabsDialog::SetModified could be implemented to change the OK button's caption to "Save". See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## m_lpfnDrawBackground *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabspage_m_lpfndrawbackground* Contains a pointer to the application supplied [background](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_background) handling callback for the tab page. C++ ``` SFTTABS_DRAWBACKGROUNDPROC CSftTabsPage::m_lpfnDrawBackground; ``` ### Comments The m_lpfnDrawBackground member contains a pointer to the application supplied background handling callback for the tab page. m_lpfnDrawBackground is used to define the application supplied background handling callback for the tab page. An application can define a background color for a tab page using the [SFTTABS_TAB](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/struct_sfttabs_tab), colorClientArea member (see [SetTabInfo](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_settabinfo)) or define a background bitmap using the [SFTTABS_CONTROL](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/struct_sfttabs_control), * hInsideBitmap* member (see [SetControlInfo](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_setcontrolinfo)). m_lpfnDrawBackground overrides other background definitions and allows an application to render the background. [CSftTabsPage::m_flagDrawBackground](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabspage_m_flagdrawbackground) can be used to define additional processing options. [CSftTabsPage::m_UserDataBackground](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabspage_m_userdatabackground) is used to define an application defined value that is passed to the background drawing callback m_lpfnDrawBackground as the *UserData* parameter. When [using C](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_usingc), the [SftTabs_TransparentControls](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_transparentcontrols) function handles background painting. ### Example This example paints a custom tab page background by filling the tab page with a tiled bitmap. C++ ``` CSamplePage::CSamplePage(CWnd* pParent /*=NULL*/) : CSftTabsPage(CSamplePage::IDD, pParent) { m_lpfnDrawBackground = SamplePage_DrawBackground; m_flagDrawBackground = SFTTABS_DRAWBG_OVERRIDETHEME; m_UserDataBackground = (SFTTABS_DWORD_PTR)this; m_BackgroundBitmap.LoadBitmap(IDB_BACKGROUND); } void CALLBACK SamplePage_DrawBackground(HDC hDC, HWND hwndDlg, HWND hwndTab, SFTTABS_DWORD_PTR UserData) { CSamplePage* pThis = (CSamplePage*)UserData; RECT rect; GetClientRect(hwndDlg, &rect); SftTabs_PaintTiledBitmap(hDC, pThis->m_BackgroundBitmap, 0, 0, &rect); } ``` See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## m_pTabCtl *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabspage_m_ptabctl* Contains a pointer to the tab control object to which the page is attached. C++ ``` protected: CSftTabs* CSftTabsPage::m_pTabCtl; ``` ### Comments The m_pTabCtl member contains a pointer to the tab control object to which the page is attached. m_pTabCtl can be used to access the tab control object to which the page is attached. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## m_UserDataBackground *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabspage_m_userdatabackground* Defines an application defined value that is passed to the [background](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_background) drawing callback [CSftTabsPage::m_lpfnDrawBackground](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabspage_m_lpfndrawbackground) as the UserData parameter. C++ ``` SFTTABS_DWORD_PTR CSftTabsPage::m_UserDataBackground; ``` ### Comments The m_UserDataBackground member defines an application defined value that is passed to the background drawing callback CSftTabsPage::m_lpfnDrawBackground as the UserData parameter. When [using C](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_usingc), the [SftTabs_TransparentControls](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_transparentcontrols) function handles background painting. ### Example This example paints a custom tab page background by filling the tab page with a tiled bitmap. C++ ``` CSamplePage::CSamplePage(CWnd* pParent /*=NULL*/) : CSftTabsPage(CSamplePage::IDD, pParent) { m_lpfnDrawBackground = SamplePage_DrawBackground; m_flagDrawBackground = SFTTABS_DRAWBG_OVERRIDETHEME; m_UserDataBackground = (SFTTABS_DWORD_PTR)this; m_BackgroundBitmap.LoadBitmap(IDB_BACKGROUND); } void CALLBACK SamplePage_DrawBackground(HDC hDC, HWND hwndDlg, HWND hwndTab, SFTTABS_DWORD_PTR UserData) { CSamplePage* pThis = (CSamplePage*)UserData; RECT rect; GetClientRect(hwndDlg, &rect); SftTabs_PaintTiledBitmap(hDC, pThis->m_BackgroundBitmap, 0, 0, &rect); } ``` See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## MoveTab *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_movetab* Moves a tab within a tab control. C ``` BOOL SftTabs_MoveTab(HWND hwndCtl, int fromIndex, int insertIndex); ``` C++ ``` BOOL CSftTabs::MoveTab(int fromIndex, int insertIndex); ``` ### Parameters hwndCtl The window handle of the tab control. fromIndex The zero-based index of the tab to be moved to the new position defined by *insertIndex*. insertIndex The zero-based index of the insertion position where the tab defined by *fromIndex* will be moved to. ### Returns The return value is TRUE if moving the tab was successful, FALSE otherwise. ### Comments Moves a tab within a tab control. All the attributes of the tab being moved are moved along with the tab. The WM_SETREDRAW Windows message can be used to suppress the tab control from being redrawn when many tabs are moved. Tabs can be deleted using [DeleteTab](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_deletetab). New tabs can be inserted at a specific location using [InsertTab](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_inserttab). See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## OnCancel *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabsdialog_oncancel* Called when the user hits the ESCAPE key or clicks the Cancel button (the button with an ID of IDCANCEL). C++ ``` virtual void CSftTabsDialog::OnCancel(); ``` ### Comments The OnCancel function is called when the user hits the ESCAPE key or clicks the Cancel button (the button with an ID of IDCANCEL). Override this member function to perform the Cancel button action. The default implementation terminates a modal dialog box by calling EndDialog and causes DoModal to return IDCANCEL. If you implement the Cancel button in a modeless tabbed dialog, you must override the OnCancel member function and call DestroyWindow. Do not call the base-class member function because it calls EndDialog, which does not destroy a modeless dialog. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## OnCancel *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabspage_oncancel* Called when the user clicks the Cancel button (the button with an ID of IDCANCEL). C++ ``` virtual void CSftTabsPage::OnCancel(); ``` ### Comments The OnCancel function is called when the user clicks the Cancel button (the button with an ID of IDCANCEL). The default implementation of this member function doesn't respond to the button. It is up to the application to override this function to do any processing. Usually, the Cancel button is located on the parent dialog, not on a page attached to a tab, so the [CSftTabsDialog::OnCancel](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabsdialog_oncancel) member function would process the Cancel button event. ### Example This example shows an OnCancel member function of a [CSftTabsPage](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) based object. The page implements its own Cancel button. To process the Cancel button, it calls the parent dialog's OnCancel member function. ``` void CPage4::OnCancel() { // Send Cancel to parent GetParentDialog()->OnCancel(); } ``` See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | C++ Classes | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## OnOK *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabsdialog_onok* Called when the user clicks the OK button (the button with an ID of IDOK). C++ ``` virtual void CSftTabsDialog::OnOK(); ``` ### Comments The OnOK function is called when the user clicks the OK button (the button with an ID of IDOK). Override this member function to perform the OK button action. The default implementation of this member function calls [CSftTabsDialog::ClosePossible](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabsdialog_closepossible) to make sure that the currently active page can be closed. Then any automatic data validation and exchange for the tabbed dialog takes place. If you implement the OK button in a modeless tabbed dialog, you must override the OnOK member function and call DestroyWindow from within it. Do not call the base-class member function because it calls EndDialog, which does not destroy a modeless dialog. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## OnOK *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabspage_onok* Called when the user clicks the OK button (the button with an ID of IDOK). C++ ``` virtual void CSftTabsPage::OnOK(); ``` ### Comments The OnOK function is called when the user clicks the OK button (the button with an ID of IDOK). Override this member function to perform the OK button action. The default implementation of this member function doesn't respond to the button. It is up to the application to override this function to do any processing. Usually, the OK button is located on the parent dialog, not on a page attached to a tab, so the [CSftTabsDialog::OnOK](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabsdialog_onok) member function would process the OK button event. ### Example This example shows an OnOK member function of a [CSftTabsPage](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) based object. The page implements its own OK button. To process the OK button, it calls the parent dialog's OnOK member function. ``` void CPage4::OnOK() { // Send OK to parent GetParentDialog()->OnOK(); } ``` See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | C++ Classes | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## PaintBitmap *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_paintbitmap* Paints a bitmap. C ``` void WINAPI SftTabs_PaintBitmap(HDC hDC, LPRECT lpRect, BOOL fStretch, HBITMAP hBitmap, COLORREF BgColor); ``` ### Parameters hDC The device context used to draw the bitmap. lpRect The area where the bitmap is painted, expressed in coordinates suitable for the device context *hDC*. fStretch Set to TRUE to fill the area described by *lpRect* with the bitmap by stretching the bitmap. Otherwise set to FALSE to center the bitmap in the area provided. hBitmap A bitmap handle describing the bitmap to be painted. BgColor The [background](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_background) color used by the area surrounding the bitmap. The [top, left pixel](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_bitmap_transparency) of the bitmap is examined and determines the bitmap's background color. The bitmap is painted after all pixels which have the bitmap's background color are replaced by the color *BgColor*. This allows the background of a window to seamlessly "flow" into the background of the bitmap. An RGB value or a GetSysColor index value can be specified for this color value. If a color index is used, the high-order bit must be set (e.g., COLOR_WINDOW | 0x80000000L). ### Returns The PaintBitmap function does not return a value. ### Comments The PaintBitmap function paints a bitmap. This function is provided to easily paint a bitmap on a dialog or window as is typically the case with [Wizard-style dialogs](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_wizardstyle). [SftTabs_PaintTiledBitmap](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_painttiledbitmap) can be used to fill an area with a bitmap, which is automatically tiled. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## PaintTiledBitmap *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_painttiledbitmap* Paints a bitmap, tiling it if necessary. C ``` void WINAPI SftTabs_PaintTiledBitmap(HDC hDC, HBITMAP hBitmap, int xOrg, int yOrg, const LPRECT lpRect); ``` ### Parameters hDC The device context used to draw the bitmap. hBitmap A bitmap handle describing the bitmap to be painted. xOrg, yOrg Defines the horizontal (*xOrg*) and vertical (*yOrg*) offset to be used to align the bitmap. The value specified must be greater than or equal to 0. If 0 is specified, the bitmap is aligned with coordinates 0/0 of the device context *hDC*. lpRect The area where the bitmap is painted, expressed in coordinates suitable for the device context *hDC*. ### Comments The PaintTiledBitmap function paints a bitmap, tiling it if necessary. This function is provided to easily paint a bitmap on a dialog or window [background](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_background). If the bitmap is smaller than the area to be painted, the bitmap will be tiled. It is possible to specify a background bitmap for a tab control using the [SFTTABS_CONTROL](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/struct_sfttabs_control) structure members *hOutsideBitmap* and *hInsideBitmap.* These bitmaps, particularly the [client area](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/pop_clientarea) portion, are only visible if the tab control is not obscured by other windows. Tab pages will automatically use the defined background color or background bitmap, but tabbed windows will not. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## PixelScaling *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_pixelscaling* Defines how caller-supplied pixel dimensions (margins, forced tab size, etc.) are interpreted relative to the current monitor DPI. C ``` void WINAPI SftTabs_SetPixelScaling(HWND hwndCtl, int mode); int WINAPI SftTabs_GetPixelScaling(HWND hwndCtl); ``` C++ ``` void CSftTabs::SetPixelScaling(int mode); int CSftTabs::GetPixelScaling() const; ``` ### Parameters hwndCtl The window handle of the tab control. mode Defines the [pixel scaling](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_dpi) mode. *mode* can be one of the following values: | | | | --- | --- | | SFTTABS_PIXELSCALING_ASIS | Caller-supplied pixel dimensions are used verbatim, in physical screen pixels. This is the default and preserves the traditional SftTabs/DLL behavior. A margin of 10 is 10 screen pixels on any monitor. | | SFTTABS_PIXELSCALING_STRETCH | Caller-supplied pixel dimensions are interpreted as 96-DPI reference pixels and are scaled by the factor *currentDPI / 96* each time they are used. A margin of 10 set on a 96-DPI monitor is 10 screen pixels at 100%, 15 pixels at 150%, 20 pixels at 200%. Storage and the corresponding Get* functions always return the value in caller-reference (96-DPI) units. | ### Returns GetPixelScaling returns a value indicating the current pixel scaling mode (SFTTABS_PIXELSCALING_ASIS or SFTTABS_PIXELSCALING_STRETCH). ### Comments The SetPixelScaling and GetPixelScaling functions define how caller-supplied pixel dimensions are interpreted relative to the current monitor DPI. The setting affects the following caller-supplied values on [SFTTABS_CONTROL](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/struct_sfttabs_control): - *leftMargin* and *rightMargin* (margin widths on the [tab row](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/pop_tabrows)), - *rowIndent* (row indentation), - *forcedSize* (forced tab row height / width). SetPixelScaling is independent of [SetImageScaling](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_imagescaling). SetPixelScaling controls how caller-supplied pixel dimensions are interpreted; SetImageScaling controls the size at which images are drawn. Either can be used without the other. SFTTABS_PIXELSCALING_ASIS (the default) preserves back-compatible behavior. A margin of 10 set on a 96-DPI monitor is 10 pixels on any monitor - useful when the application is already DPI-aware and performs its own scaling, but means the margin appears physically smaller on high-DPI monitors. SFTTABS_PIXELSCALING_STRETCH makes caller-supplied pixel values resolution-independent. Margins, indentation and forced tab sizes stay physically the same as the user moves between monitors of different DPI. Because storage and the corresponding Get* functions always return caller-reference units, serialized configurations remain portable between machines of different DPI and between different monitors of the same machine. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## QueryChar *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_querychar* Tests if a tab control responds to the specified character, i.e. the character is an accelerator key which the tab control processes. C ``` BOOL SftTabs_QueryChar(HWND hwndCtl, int ch); BOOL SftTabs_QueryChar_A(HWND hwndCtl, int ch); BOOL SftTabs_QueryChar_W(HWND hwndCtl, WCHAR ch); ``` C++ ``` int CSftTabs::QueryChar(TCHAR ch) const; ``` ### Parameters hwndCtl The window handle of the tab control. ch The character to be tested. ### Returns The return value is TRUE if the tab control responds to the specified character, otherwise FALSE. ### Comments The QueryChar function tests if a tab control responds to the specified character, i.e. the character is an accelerator key which the tab control processes. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## RegisterApp *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_registerapp* Registers the application for use of SftTabs/DLL controls. C ``` BOOL WINAPI SftTabs_RegisterApp(HINSTANCE hInst); ``` C++ ``` static BOOL CSftTabs::RegisterApp(); ``` ### Parameters hInst The instance handle of the application, which will use SftTabs/DLL controls. ### Returns The return value is TRUE if SftTabs/DLL has been initialized for this application, otherwise FALSE is returned. ### Comments The RegisterApp function registers the application for use of SftTabs/DLL controls. This call allows SftTabs/DLL to register all required window classes for the calling application. This call has to be made before any SftTabs/DLL controls are created. An application should call [UnregisterApp](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_unregisterapp) once the application no longer uses SftTabs/DLL controls. The call to this function should be made during application initialization. ### Example This example registers an application with SftTabs/DLL: C ``` int PASCAL WinMain(HINSTANCE hinst, HINSTANCE hinstPrev, LPSTR Cmd, int cmdShow) { SftTabs_RegisterApp(hinst); // Register application .... application message loop SftTabs_UnregisterApp(hinst); // Unregister application return msg.wParam; } ``` C++ ``` BOOL CSampleApp::InitInstance() // based on CWinApp { CSftTabs::RegisterApp(); // Register to use SftTabs/DLL .... other initialization return TRUE; ``` See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## RegisterDialog *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_registerdialog* Registers a window or a dialog containing a tab control. Once registered, SftTabs/DLL will perform special tabbed dialog handling, such as accelerator key handling, ESCAPE and TAB key processing, etc. C ``` BOOL WINAPI SftTabs_RegisterDialog(HWND hwndDialog); BOOL WINAPI SftTabs_RegisterWindow(HWND hwndWnd); ``` ### Parameters hwndDialog, hwndWnd The window handle of the window or dialog to be registered. ### Returns The return value is TRUE if the window is successfully registered with SftTabs/DLL. ### Comments The RegisterDialog function registers a window or a dialog containing a tab control. Once registered, SftTabs/DLL will perform special tabbed dialog handling, such as accelerator key handling, ESCAPE and TAB key processing, etc. If this function is not called, certain features of SftTabs/DLL may not appear to be working correctly, such as accelerator keys, tab switching, ESCAPE key handling, etc. A window or dialog registered using this function, must also be unregistered using [SftTabs_UnregisterDialog](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_unregisterdialog) or SftTabs_UnregisterWindow. ### 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](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## ResetContent *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_resetcontent* Removes all tabs from a tab control. C ``` void SftTabs_ResetContent(HWND hwndCtl); ``` C++ ``` void CSftTabs::ResetContent(); ``` ### Parameters hwndCtl The window handle of the tab control. ### Comments The ResetContent function removes all tabs from a tab control. A tab control without tabs no longer paints a tab border or [client area](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/pop_clientarea). ### Example C ``` SftTabs_ResetContent(hwndTab); ``` C++ ``` m_Tab.ResetContent(); ``` See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## ResizePages *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_resizepages* Resizes attached pages when using a frame window. C ``` void SftTabs_ResizePages(HWND hwndCtl); ``` C++ ``` void CSftTabs::ResizePages(); ``` ### Parameters hwndCtl The window handle of the tab control. ### Comments The ResizePages function resizes attached pages when using a frame window. ResizePages should be used whenever a frame window has been resized. A frame window is used when a tab control does not have a [client area](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/pop_clientarea). That frame window "holds" the pages that are attached to a tab control. If the user or the application resizes this frame window, ResizePages must be called so the tab control can adjust the sizes of all attached pages. A frame window is defined using [SftTabs_ActivatePage](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_activatepage), [SetControlInfo](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_setcontrolinfo), [CSftTabsDialog::InitializeTabControl](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabsdialog_initializetabcontrol) or [CSftTabsWindowSheet::InitializeTabControl](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabswindowsheet_initializetabcontrol). See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## ScrollTabs *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_scrolltabs* Scrolls tabs in the direction specified. C ``` int SftTabs_ScrollTabs(HWND hwndCtl, BOOL fUpOrLeft); ``` C++ ``` int CSftTabs::ScrollTabs(BOOL fUpOrLeft); ``` ### Parameters hwndCtl The window handle of the tab control. fUpOrLeft TRUE to scroll left (or up in a vertical tab control), FALSE to scroll right or down. ### Returns The return value is the index of the new leftmost (topmost) tab visible, or -1 if an error occurred. ### Comments The ScrollTabs function scrolls tabs in the direction specified. ScrollTabs can only be used with scrollable tab controls. The members *fLeftButton* and *fRightButton* of the [SFTTABS_CONTROL](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/struct_sfttabs_control) structure can be tested to see if scrolling in either direction is currently possible. ### Example This example scrolls all tabs left by one position: C ``` SftTabs_ScrollTabs(hwndTab, TRUE); ``` C++ ``` m_Tab.ScrollTabs(TRUE); ``` See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## SetAllowAllInactive *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_setallowallinactive* Defines whether all tabs can become inactive. C ``` void SftTabs_SetAllowAllInactive(HWND hwndCtl, BOOL fSet); ``` C++ ``` void CSftTabs::SetAllowAllInactive(BOOL fSet = TRUE); ``` ### Parameters hwndCtl The window handle of the tab control. fSet If TRUE is specified, [SetCurrentTab](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_setcurrenttab) and [SetCurrentTabEx](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_setcurrenttabex) can be used to deactivate all tabs. If FALSE is specified, SetCurrentTab and SetCurrentTabEx can only be used to activate a new tab. ### Comments The SetAllowAllInactive function defines whether all tabs can become inactive. SetAllowAllInactive affects all subsequent calls to SetCurrentTab and SetCurrentTabEx. SetAllowAllInactive does not change the currently [active tab](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/pop_activetab), if any. ### Example This example makes all tabs inactive: C ``` SftTabs_SetAllowAllInactive(hwndTab, TRUE); SftTabs_SetCurrentTab(hwndTab, -1); ``` C++ ``` m_Tab.SetAllowAllInactive(TRUE); m_Tab.SetCurrentTab(-1); ``` See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## SetClose *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabsdialog_setclose* Signals that data has been changed permanently and the tabbed dialog can no longer be Cancel'ed. C++ ``` virtual void CSftTabsDialog::SetClose(BOOL fClose = TRUE); ``` ### Parameters fClose Set to TRUE to allow the tabbed dialog to close, FALSE otherwise. The value is used in the application's SetClose function, which must be implemented in the derived class. ### Comments The SetClose function signals that data has been changed permanently and the tabbed dialog can no longer be Cancel'ed. When input data is altered permanently, the tabbed dialog or page should use CSftTabsDialog::SetClose or [CSftTabsPage::SetClose](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabspage_setclose). An application could override the CSftTabsDialog::SetClose member function to visually notify the user that data has been permanently altered. SetClose could be implemented to change the Cancel button's caption to "Close". There is no default implementation for the SetClose function. It is up to the application to implement SetClose in a derived class. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## SetClose *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabspage_setclose* Signals that data has been changed permanently and the tabbed dialog can no longer be Cancel'ed. C++ ``` virtual void CSftTabsPage::SetClose(BOOL fClose = TRUE); ``` ### Parameters fClose Set to TRUE to allow the tabbed dialog to close, FALSE otherwise. The value is used in the application's SetClose function, which must be implemented in the derived class. ### Comments The SetClose function signals that data has been changed permanently and the tabbed dialog can no longer be Cancel'ed. When input data is altered permanently, the tabbed dialog or page should use [CSftTabsDialog::SetClose](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabsdialog_setclose) or CSftTabsPage::SetClose. An application could override the CSftTabsDialog::SetClose member function to visually notify the user that data has been permanently altered. SetClose could be implemented to change the Cancel button's caption to "Close". There is no default implementation for the SetClose function. It is up to the application to implement SetClose in a derived class. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## SetControlInfo *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_setcontrolinfo* Sets tab control attributes. C ``` BOOL SftTabs_SetControlInfo(HWND hwndCtl, LPCSFTTABS_CONTROL lpCtl); ``` C++ ``` BOOL CSftTabs::SetControlInfo(LPCSFTTABS_CONTROL lpCtl); ``` ### Parameters hwndCtl The window handle of the tab control. lpCtl A pointer to a [SFTTABS_CONTROL](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/struct_sfttabs_control) structure. This structure will be used to define the new tab control attributes. ### Returns The return value is TRUE if the function was successful, otherwise FALSE is returned. ### Comments The SetControlInfo function sets tab control attributes. If the SFTTABS_CONTROL structure defines a tab control that is invalid, the [current tab](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/pop_activetab) control settings remain unchanged and the function returns FALSE. The following validations take place to insure that a tab control is valid: - the style specified in *style* has to be valid - *nRows* must be at least 1 and less or equal to the number of tabs - if *nRows* is > 1, the new tab style must support multiple [rows of tabs](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/pop_tabrows) - if *leftMargin* or *rightMargin* is > 1, the new tab style must support margins - if a specific number of tabs per row is defined (*nRowTabs*), tabs must be defined as fixed width tabs (*fFixed*) - if a [client area](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/pop_clientarea) is requested (*fClientArea*), the new tab style must support a client area - if a scrollable tab control is requested (*fScrollable*), the new tab style must support scrollable tabs - if a scrollable tab control is requested (*fScrollable*), the number of tab rows requested must be one (*nRows*) - if a scrollable tab control is requested (*fScrollable*), the tab rows cannot be filled completely (*fFillComplete*) - if a [scroll button](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/pop_scrollbutton) bitmap handle is supplied (*hButtonBitmap* and * hButtonBitmapDisabled*), the handles must be valid or NULL - if hidden scroll buttons are requested (*fHideScrollButtons*), the tab control must be defined as scrollable (*fScrollable*) - if multiline tab text is requested, the new tab style must support multiline tab text - if conditional scroll buttons are requested (*fCondScrollButtons*), the tab control must be defined as scrollable (*fScrollable*) - conditional scroll buttons (*fCondScrollButtons*)* *and hidden scroll buttons (*fHideScrollButtons*) are mutually exclusive - the button style (*buttonStyle*) specified must be a valid style - if scroll buttons are requested on the left/top (*fScrollOnLeft*), the tab control must be defined as scrollable (*fScrollable*) - if a bitmap is specified for the Minimize, Restore and Close buttons (*hButtonBitmap2*), it must be a valid bitmap handle - if a disabled images bitmap is specified for the Minimize, Restore and Close buttons (*hButtonBitmap2Disabled*), it must be a valid bitmap handle - the scroll button alignment (*buttonAlignment*) must be valid - the Minimize, Restore and Close button alignment (*closeButtonAlignment*) must be valid ### Example This example retrieves the current tab control attributes and modifies the number of tab rows: C ``` SFTTABS_CONTROL Ctl; SftTabs_GetControlInfo(hwndTab, &Ctl); Ctl.nRows = 1; SftTabs_SetControlInfo(hwndTab, &Ctl); ``` C++ ``` SFTTABS_CONTROL Ctl; m_Tab.GetControlInfo(&Ctl); Ctl.nRows = 1; m_Tab.SetControlInfo(&Ctl); ``` See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## SetCtlColors *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_setctlcolors* Sets the tab control's color attributes. C ``` void SftTabs_SetCtlColors(HWND hwndCtl, LPCSFTTABS_COLORS lpColors); ``` C++ ``` void CSftTabs::SetCtlColors(LPCSFTTABS_COLORS lpColors); ``` ### Parameters hwndCtl The window handle of the tab control. lpColors A pointer to a [SFTTABS_COLORS](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/struct_sfttabs_colors) structure containing the color definitions. ### Comments The SetCtlColors function sets the tab control's color attributes. Using [GetCtlColors](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_getctlcolors) and SetCtlColors is the preferred method to change color attributes. Although a tab control generates [WM_CTLCOLORSTATIC](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_windows_messages) messages, the WM_CTLCOLORSTATIC message handling is provided for compatibility with SftTabs 2.0 only. When using [Windows themes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_using_themes), the colors are determined by the defined theme and defined colors are ignored. ### Example This example changes the tab control's foreground and [background](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_background) colors: C ``` SFTTABS_COLORS Colors; SftTabs_GetCtlColors(hwndTab, &Colors); /* Get current color settings */ Colors.colorBg = COLOR_WINDOW | 0x800000000L; /* Background color */ Colors.colorFg = RGB(0,0,128); /* Foreground color */ SftTabs_SetCtlColors(hwndTab, &Colors); /* Set new colors */ ``` C++ ``` SFTTABS_COLORS Colors; m_Tabs.GetCtlColors(&Colors); /* Get current color settings */ Colors.colorBg = COLOR_WINDOW | 0x800000000L; /* Background color */ Colors.colorFg = RGB(0,0,128); /* Foreground color */ m_Tabs.SetCtlColors(&Colors); /* Set new colors */ ``` See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## SetCurrentTab *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_setcurrenttab* Makes the specified tab the new [active tab](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/pop_activetab). C ``` int SftTabs_SetCurrentTab(HWND hwndCtl, int iTab); ``` C++ ``` int CSftTabs::SetCurrentTab(int iTab); ``` ### Parameters hwndCtl The window handle of the tab control. iTab The zero-based index of the tab to be activated. All tabs can be deactivated by specifying -1 (based on the settings defined by [SetAllowAllInactive](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_setallowallinactive)). ### Returns The return value is the index of the new active tab, otherwise -1 is returned. ### Comments The SetCurrentTab function makes the specified tab the new active tab. When using this function to activate a new tab, the normal tab switching mechanism takes place, such as calling the [SFTTABS_TABCALLBACK](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/typedef_sfttabs_tabcallback) tab callback function, the [CSftTabsPage::AllowSwitch](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabspage_allowswitch) or [CSftTabsWindowPage::AllowSwitch](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabswindowpage_allowswitch) member functions of the C++ based implementation of tabbed dialog. A disabled tab cannot be activated. Use [SetCurrentTabEx](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_setcurrenttabex) to activate a disabled tab. This example makes the third tab the new active tab: C ``` SftTabs_SetCurrentTab(hwndTab, 2); ``` C++ ``` m_Tab.SetCurrentTab(2); ``` See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## SetCurrentTabEx *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_setcurrenttabex* Makes the specified tab the new [active tab](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/pop_activetab). C ``` int SftTabs_SetCurrentTabEx(HWND hwndCtl, int iTab); ``` C++ ``` int CSftTabs::SetCurrentTabEx(int iTab); ``` ### Parameters hwndCtl The window handle of the tab control. iTab The zero-based index of the tab to be activated. All tabs can be deactivated by specifying -1 (based on the settings defined by [SetAllowAllInactive](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_setallowallinactive)). ### Returns The return value is the index of the new active tab, otherwise -1 is returned. ### Comments The SetCurrentTabEx function makes the specified tab the new active tab. When using this function to activate a new tab, the normal tab switching mechanism takes place, such as calling the [SFTTABS_TABCALLBACK](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/typedef_sfttabs_tabcallback) tab callback function, the [CSftTabsPage::AllowSwitch](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabspage_allowswitch) or [CSftTabsWindowPage::AllowSwitch](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabswindowpage_allowswitch) member functions of the C++ based implementation of tabbed dialog. [SetCurrentTab](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_setcurrenttab) also changes the current tab, but only SetCurrentTabEx can be used to activate a disabled tab. ### Example This example makes the third tab the new active tab: C ``` SftTabs_SetCurrentTabEx(hwndTab, 2); ``` C++ ``` m_Tab.SetCurrentTabEx(2); ``` See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## SetDragInfo *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_setdraginfo* Updates the drag & drop information while handling [SFTTABSN_DRAGMOVE](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications)/SFTTABSN_DRAGDROP notifications. C ``` void SftTabs_SetDragInfo(HWND hwndCtl, LPCSFTTABS_DRAGINFO lpDragInfo); ``` C++ ``` void CSftTabs::SetDragInfo(LPCSFTTABS_DRAGINFO lpDragInfo); ``` ### Parameters hwndCtl The window handle of the tab control where tab reordering or drag & drop originated. lpDragInfo A pointer to a [SFTTABS_DRAGINFO](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/struct_sfttabs_draginfo) structure containing the updated drag & drop definitions. Only the *targetAllowed* of the SFTTABS_DRAGINFO structure is honored. ### Comments The SetDragInfo function updates the drag & drop information while handling SFTTABSN_DRAGMOVE/SFTTABSN_DRAGDROP notifications. [GetDragInfo](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_getdraginfo) and SetDragInfo can be used to disallow dragging to a target window (see SFTTABS_DRAGINFO, *targetAllowed*). See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | Notifications ## SetDrawTabCallback *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_setdrawtabcallback* Defines a drawing callback routine used to paint tab labels. C ``` BOOL WINAPI SftTabs_SetDrawTabCallback(HWND hwndCtl, LPSFTTABS_DRAWPROCPARM lpDrawProcParm); ``` C++ ``` BOOL CSftTabs::SetDrawTabCallback(LPSFTTABS_DRAWPROCPARM lpDrawProcParm = NULL); ``` ### Parameters hwndCtl The window handle of the tab control. lpDrawProcParm A pointer to a [SFTTABS_DRAWPROCPARM](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/struct_sfttabs_drawprocparm) structure containing the parameters for this function to register a drawing callback function and user supplied data. This parameter may be NULL to stop using the callback function. The SFTTABS_DRAWPROCPARM structure contains the following members: | | | | --- | --- | | [SFTTABS_DRAWTABPROC](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/typedef_sfttabs_drawtabproc) lpfnDrawProc | A pointer to a drawing callback routine which calculates the tab label size and paints tab labels. | | [SFTTABS_DWORD_PTR](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/typedef_sfttabs_dword_ptr) UserData | An application specific value. This value is passed to the drawing callback (SFTTABS_DRAWTABPROC) as the *UserData* parameter. | ### Returns The return value is TRUE if the function was successful, otherwise FALSE is returned. ### Comments Defines a drawing callback routine used to paint tab labels. The callback function uses the information passed in the [SFTTABS_DRAWINFO](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/struct_sfttabs_drawinfo) structure to calculate or paint tab labels. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## SetModified *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabsdialog_setmodified* Sets the current data modification flag for the tabbed dialog. C++ ``` virtual void CSftTabsDialog::SetModified(BOOL fModified = TRUE); ``` ### Parameters fModified The new value to be saved as the data modification flag. TRUE if data has been modified, FALSE otherwise. ### Comments The SetModified function sets the current data modification flag for the tabbed dialog. The maintenance of the data modification flag is up to the application. When input data is altered, the tabbed dialog or page should use CSftTabsDialog::SetModified or [CSftTabsPage::SetModified](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabspage_setmodified) to mark data as modified. There is only one data modification flag for a tabbed dialog. When using CSftTabsPage::SetModified (a page), the tabbed dialog's modification flag is updated, so a subsequent [CSftTabsPage::GetModified](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabspage_getmodified) (by another page attached to the same tab control) will return the value of the tabbed dialog's modification flag. An application could override the CSftTabsDialog::SetModified member function to visually notify the user that data has been modified. CSftTabsDialog::SetModified could be implemented to change the OK button's caption to "Save". See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## SetModified *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabspage_setmodified* Sets the current data modification flag for the tabbed dialog. C++ ``` virtual void CSftTabsPage::SetModified(BOOL fModified = TRUE); ``` ### Parameters fModified The new value to be saved as the data modification flag. TRUE if data has been modified, FALSE otherwise. ### Comments The SetModified function sets the current data modification flag for the tabbed dialog. The maintenance of the data modification flag is up to the application. When input data is altered, the tabbed dialog or page should use [CSftTabsDialog::SetModified](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabsdialog_setmodified) or CSftTabsPage::SetModified to mark data as modified. There is only one data modification flag for a tabbed dialog. When using CSftTabsPage::SetModified (a page), the tabbed dialog's modification flag is updated, so a subsequent [CSftTabsPage::GetModified](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabspage_getmodified) (by another page attached to the same tab control) will return the value of the tabbed dialog's modification flag. An application could override the CSftTabsDialog::SetModified member function to visually notify the user that data has been modified. SetModified could be implemented to change the OK button's caption to "Save". See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## SetPageActive *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_setpageactive* Notifies a tab control that the page attached to the currently [active tab](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/pop_activetab) has been activated. C ``` void WINAPI SftTabs_SetPageActive(HWND hwndSubDlg, HWND hwndTab, LPVOID lpTabData); ``` ### Parameters hwndSubDlg The window handle of the page attached to the currently active tab. This value is saved in the *hwndSubDlg* member of the [SFTTABS_CONTROL](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/struct_sfttabs_control) structure. hwndTab The window handle of the tab control. lpTabData An application defined value. This value is saved in the *lpTabData* member of the SFTTABS_CONTROL structure. For the C++ tabbed dialog and window implementation, this is the page object, otherwise this parameter should be NULL. ### Comments The SetPageActive function notifies a tab control that the page attached to the currently active tab has been activated. The page is automatically resized to fit inside the tab control's [client area](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/pop_clientarea) (or a supplied frame window, see SFTTABS_CONTROL), certain incompatible [window styles](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_windowstyles) are changed and the page is made visible. The call to SftTabs_SetPageActive should always be performed in the page's WM_INITDIALOG message handler or the [SFTTABS_TABCALLBACK](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/typedef_sfttabs_tabcallback) function. For C++, the call is automatic when using the supplied classes. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## SetPageInactive *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_setpageinactive* Notifies a tab control that the page attached to the currently [active tab](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/pop_activetab) has been deactivated. C ``` void WINAPI SftTabs_SetPageInactive(HWND hwndTab); ``` ### Parameters hwndTab The window handle of the tab control. ### Comments The SetPageInactive function notifies a tab control that the page attached to the currently active tab has been deactivated. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## SetTabDialog *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabs_settabdialog* Sets the [CSftTabsPage](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) based object pointer attached to the specified tab. C++ ``` void CSftTabs::SetTabDialog(int iTab, CSftTabsPage* pPage); ``` ### Parameters iTab The zero-based index of the tab for which information is to be set. pPage A pointer to the CSftTabsPage based object representing the page attached to the tab specified. ### Comments The SetTabDialog function sets the CSftTabsPage based object pointer attached to the specified tab. This function is used by the CSftTabsDialog and CSftTabsPage class implementation. When a tab is made the [active tab](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/pop_activetab), the CSftTabsPage based dialog is created or made visible. ### Example C++ ``` /* We are using new features */ m_Tab.SetVersion(SFTTABS_7_0); index = m_Tab.AddTab(_T("The First One")); m_Tab.SetToolTip(index, _T("Demonstrates tabbing into and out of the tab page")); Tab = Tab0; Tab.graph.item.hBitmap = (HBITMAP) m_SampleBitmap.m_hObject; m_Tab.SetTabInfo(index, &Tab); m_Tab.SetTabDialog(index, new CPage1(this)); /* tab page */ ``` See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | C++ Classes | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## SetTabInfo *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_settabinfo* Sets the tab attributes for the specified tab. C ``` BOOL SftTabs_SetTabInfo(HWND hwndCtl, int iTab, LPCSFTTABS_TAB lpTab); ``` C++ ``` BOOL CSftTabs::SetTabInfo(int iTab, LPCSFTTABS_TAB lpTab); ``` ### Parameters hwndCtl The window handle of the tab control. iTab The zero-based index of the tab for which attributes are to be defined. lpTab A pointer to a [SFTTABS_TAB](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/struct_sfttabs_tab) structure. This structure will be used to define the tab attributes. ### Returns The return value is TRUE if the function was successful, otherwise FALSE is returned. ### Comments The SetTabInfo function sets the tab attributes for the specified tab. If the SFTTABS_TAB structure defines invalid tab attributes, the [current tab](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/pop_activetab) settings remain unchanged and the function returns FALSE. ### Example This example retrieves the tab attributes for the third tab and modifies the [background](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_background) color: C ``` SFTTABS_TAB Tab; SftTabs_GetTabInfo(hwndTab, 2, &Tab); Tab.colorBg = RGB(255, 0, 0); SftTabs_SetTabInfo(hwndTab, 2, &Tab); ``` C++ ``` SFTTABS_TAB Tab; m_Tab.GetTabInfo(2, &Tab); Tab.colorBg = RGB(255, 0, 0); m_Tab.SetTabInfo(2, &Tab); ``` See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## SetTabLabel *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_settablabel* Sets a tab's text. C ``` BOOL SftTabs_SetTabLabel(HWND hwndCtl, int iTab, LPCTSTR lpsz); BOOL SftTabs_SetTabLabel_A(HWND hwndCtl, int iTab, LPCSTR lpsz); BOOL SftTabs_SetTabLabel_W(HWND hwndCtl, int iTab, LPCWSTR lpsz); ``` C++ ``` BOOL CSftTabs::SetTabLabel(int iTab, LPCTSTR lpsz); ``` ### Parameters hwndCtl The window handle of the tab control. iTab The zero-based index of the tab for which the tab text is to be set. lpsz A pointer to a buffer containing the tab's text. ### Returns The return value is TRUE if the function was successful, otherwise FALSE is returned. ### Comments The SetTabLabel function sets a tab's text. The tab control creates a copy of the string supplied. A tab's text can be retrieved using [GetTabLabel](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_gettablabel). ### Example This example sets the text of the second tab: C ``` SftTabs_SetTabLabel(hwndTab, 1, "New Text"); ``` C++ ``` m_Tab.SetTabLabel(1, "New Text"); ``` See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## SetTabWindowPage *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabs_settabwindowpage* Sets the [CSftTabsWindowPage](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) based object pointer attached to the specified tab. C++ ``` void CSftTabs::SetTabWindowPage(int iTab, CSftTabsWindowPage* pPage, HWND hWnd = NULL); ``` ### Parameters iTab The zero-based index of the tab for which information is to be set. pPage A pointer to the CSftTabsWindowPage based object representing the page attached to the tab specified. hwnd Reserved for future use. ### Comments The SetTabWindowPage function sets the CSftTabsWindowPage based object pointer attached to the specified tab. This function is used by the CSftTabsWindowSheet and CSftTabsWindowPage class implementation. When a tab is made the [active tab](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/pop_activetab), the CSftTabsWindowPage based dialog is created or made visible. ### Example C++ ``` /* We are using new features */ m_MainTab.SetVersion(SFTTABS_7_0); index = m_MainTab.AddTab(_T("&1 Text")); m_MainTab.SetToolTip(index, _T("Displays the currently opened file")); m_MainTab.SetTabInfo(index, &Tab0); m_MainTab.SetTabWindowPage(index, m_pTabEdit); m_pTabEdit->SaveContext(&m_SavedContext); // save doc/view context ``` See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | C++ Classes | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## SetToolTip *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_settooltip* Sets a tab's [ToolTip](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_tooltips) text. C ``` BOOL SftTabs_SetToolTip(HWND hwndCtl, int iTab, LPCTSTR lpsz); BOOL SftTabs_SetToolTip_A(HWND hwndCtl, int iTab, LPCSTR lpsz); BOOL SftTabs_SetToolTip_W(HWND hwndCtl, int iTab, LPCWSTR lpsz); ``` C++ ``` BOOL CSftTabs::SetToolTip(int iTab, LPCTSTR lpsz); ``` ### Parameters hwndCtl The window handle of the tab control. iTab The zero-based index of the tab for which the ToolTip text is to be set. lpsz A pointer to a null-terminated buffer containing the tab's ToolTip text. ### Returns The return value is TRUE if the function was successful, otherwise FALSE is returned. ### Comments The SetToolTip function sets a tab's ToolTip text. The tab control creates a copy of the string supplied. A tab's text can be retrieved using [GetToolTip](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_gettooltip). ### Example This example sets the text of the second tab's ToolTip: C ``` SftTabs_SetToolTip(hwndTab, 1, "New Text"); ``` C++ ``` m_Tab.SetToolTip(1, "New Text"); ``` See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## SetVersion *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_setversion* Sets the SftTabs/DLL version an application requires. C ``` BOOL SftTabs_SetVersion(HWND hwndCtl, int version); ``` C++ ``` BOOL CSftTabs::SetVersion(int version); ``` ### Parameters hwndCtl The window handle of the tab control. version A value indicating for which SftTabs/DLL version the application was developed: | | | | --- | --- | | SFTTABS_2_0 | The application was developed for use with SftTabs 2.0. | | SFTTABS_2_1 | The application was developed for use with SftTabs/DLL 2.1. | | SFTTABS_2_2 | The application was developed for use with SftTabs/DLL 2.2. | | SFTTABS_3_5 | The application was developed for use with SftTabs/DLL 3.5. | | SFTTABS_4_0 | The application was developed for use with SftTabs/DLL 4.0. | | SFTTABS_4_5 | The application was developed for use with SftTabs/DLL 4.5. | | SFTTABS_5_0 | The application was developed for use with SftTabs/DLL 5.0. | | SFTTABS_6_0 | The application was developed for use with SftTabs/DLL 6.5. | | SFTTABS_7_0 | The application was developed for use with SftTabs/DLL 7.0. | ### Returns The return value is TRUE if the function was successful, otherwise FALSE is returned. ### Comments The SetVersion function sets the SftTabs/DLL version an application requires. When developing new applications, always use SetVersion(SFTTABS_7_0) to be compatible with SftTabs/DLL as documented in this reference. If SetVersion is not used, compatibility with version 2.0 is the default. SetVersion must be used for *each* tab control in an application. Most features that were introduced with version 2.1 or 2.2 are available even if SetVersion(SFTTABS_2_0) is used. SetVersion cannot be used to disable [new features](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_newfeatures). Its purpose is to make sure that certain API calls have the correct result. Certain features have been modified between 2.0 and 2.1 so the calls actually behave differently. New behavior with SFTTABS_3_5, SFTTABS_4_0, SFTTABS_4_5, SFTTABS_5_0, SFTTABS_6_0, SFTTABS_7_0: - Enables new features introduced in version 3.5, 4.0, 4.5, 5.0, 6.0, 6.5 and 7.0 respectively. New behavior with SFTTABS_2_1, SFTTABS_2_2: - Enables new features introduced in version 2.1 or 2.2. - If the tab control is resized, pages attached to the tab control are resized even if they are controlled via a frame window (see [SftTabs_ActivatePage](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_activatepage), [SetControlInfo](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_setcontrolinfo), [CSftTabsDialog::InitializeTabControl](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabsdialog_initializetabcontrol) or [CSftTabsWindowSheet::InitializeTabControl](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabswindowsheet_initializetabcontrol) for more information on frame windows). - The [SFTTABS_CONTROL](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/struct_sfttabs_control) structure members *fToolTips*, *fDropText* and *fCondScrollButtons* are honored. - Ctrl+Tab and Ctrl+Shift+Tab select the next or previous tab. - [SftTabs_SetPageActive](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_setpageactive) no longer removes the WS_TABSTOP style from an attached page. - SftTabs_SetPageActive no longer copies a page's window caption to the enclosing window. ### Example This example sets version 7.0 compatibility: C ``` SftTabs_SetVersion(hwndTab, SFTTABS_7_0); ``` C++ ``` m_Tab.SetVersion(SFTTABS_7_0); ``` See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## SFTTABS_CLASS Preprocessor Symbol *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/def_sfttabs_class* Defines the SftTabs/DLL control window class name. ``` #define SFTTABS_CLASS "SftTabsControl70" /* Tab Control Window Class */ ``` ### Comments The SFTTABS_CLASS preprocessor symbol defines the SftTabs/DLL control window class name. The actual class name (SftTabsControl70) usually changes between SftTabs/DLL releases. ### Example C ``` /* Create the tab control */ pfrm->hwndTab = CreateWindow( /* Create the tab control */ TEXT(SFTTABS_CLASS), /* Window Class */ TEXT(""), /* Window Title (not used) */ WS_CHILD|WS_VISIBLE| /* Window Style */ WS_CLIPCHILDREN|WS_TABSTOP| SFTTABSSTYLE_STANDARD, 0, 0, /* x, y */ 0, 0, /* cx, cy */ hwnd, /* Parent Window */ (HMENU) IDC_TAB, /* Tab control ID */ g_hInst, /* Application Instance */ NULL); /* creation data */ if (pfrm->hwndTab == NULL) /* create failed */ return -1; ``` See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## SFTTABS_COLORS Structure *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/struct_sfttabs_colors* The SFTTABS_COLORS structure is used with [GetCtlColors](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_getctlcolors) and [SetCtlColors](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_setctlcolors) to retrieve and set a tab control's color attributes. ``` typedef struct tagTabsColors { COLORREF colorBg; /* background color */ COLORREF colorFg; /* foreground color */ COLORREF color1; /* usually used for black border */ COLORREF color2; /* usually used for shadow lines */ COLORREF color3; /* usually used for highlight lines */ COLORREF color4; /* usually used for somewhat highlight'ed lines */ COLORREF btnFace, btnShadow, btnHighlight, btnText, btnGrayText, btnBorder; /* Button colors */ COLORREF res7, res8, res9, res10; /* reserved */ COLORREF res11, res12; COLORREF res13, res14, res15, res16; } SFTTABS_COLORS, * LPSFTTABS_COLORS; typedef const SFTTABS_COLORS * LPCSFTTABS_COLORS; ``` ### Members colorBg The default [background](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_background) color used for the tab control. Tabs can override the default background color using [SFTTABS_TAB](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/struct_sfttabs_tab) *colorBg* or *colorBgSel*. When [using themes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_using_themes), this color value is ignored. colorFg The default foreground color used to draw tab label text. Tabs can override the default foreground color using SFTTABS_TAB *colorFg* or *colorFgSel*. When using themes, this color value is ignored. color1 The color used to draw the lines indicating the tab control border, preferably the darkest color available. When using themes, this color value is ignored. color2 The color used to draw the lines away from the light source, indicating a shadow, preferably a dark color. When using themes, this color value is ignored. color3 The color used to draw the lines directly exposed to the light source, indicating a highlight, preferably a bright color. When using themes, this color value is ignored. color4 The color used to draw the lines somewhat exposed to the light source, preferably a bright color, but of lesser intensity than *color3*. This color value is not used by all tab styles. When using themes, this color value is ignored. btnFace The color used to fill the inside of the [scroll buttons](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/pop_scrollbutton). When using themes, this color value is ignored. btnShadow The scroll button color used to draw the lines away from the light source, indicating a shadow, preferably a dark color. When using themes, this color value is ignored. btnHighlight The scroll button color used to draw the lines directly exposed to the light source, indicating a highlight, preferably a bright color. When using themes, this color value is ignored. btnText Reserved. Initialize to [SFTTABS_NOCOLOR](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/def_sfttabs_nocolor). When using themes, this color value is ignored. btnGrayText Reserved. Initialize to SFTTABS_NOCOLOR. btnBorder The scroll button color used to draw the lines indicating the button border, preferably the darkest color available. When using themes, this color value is ignored. res7 - res16 Reserved. Not Used. ### Comments The SFTTABS_COLORS structure is used with GetCtlColors and SetCtlColors to retrieve and set a tab control's color attributes. Not all color values are used by all the tab styles. Some tab styles do not honor *color1* - *color4* settings. To determine support for a particular color setting, use the [SftTabs/DLL Wizard](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_wizarddesign) application. If SFTTABS_NOCOLOR is specified for any of the color values, the default color (usually derived from Control Panel settings) is used. An RGB value or a GetSysColor index value can be specified for all color values. If a color index is used, the high-order bit must be set (e.g., COLOR_WINDOW | 0x80000000L). ### Example This example changes the tab control's foreground and background colors. C ``` SFTTABS_COLORS Colors; SftTabs_GetCtlColors(hwndTab, &Colors); /* Get current color settings */ Colors.colorBg = COLOR_WINDOW | 0x80000000L; /* Background color */ Colors.colorFg = RGB(0,0,128); /* Foreground color */ SftTab_SetCtlColors(hwndTab, &Colors); /* Set new colors */ ``` C++ ``` SFTTABS_COLORS Colors; m_Tab.GetCtlColors(&Colors); /* Get current color settings */ Colors.colorBg = COLOR_WINDOW | 0x80000000L; /* Background color */ Colors.colorFg = RGB(0,0,128); /* Foreground color */ m_Tab.SetCtlColors(&Colors); /* Set new colors */ ``` See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## SFTTABS_CONTROL Structure *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/struct_sfttabs_control* Describes a tab control's layout and attributes. ``` typedef struct tagSftTabsControl { /* Modifiable fields */ int style; /* tab style */ int nRows; /* number of rows */ int nRowTabs; /* number of tabs per row (if fFixed) */ int leftMargin; /* width of left margin */ int rightMargin; /* width of right margin */ BOOL fFixed; /* same width for all tabs */ BOOL fClientArea; /* Client area wanted */ BOOL fMultiline; /* allow mulitline label text */ BOOL fDialog; /* use with dialog */ BOOL fTextOnly; /* use specified background color only for text */ BOOL fScrollable; /* scrollable tabs */ BOOL fHideScrollButtons; /* hide scroll buttons */ BOOL fBoldFont; /* use bold font for active tab */ BOOL fFillComplete; /* fill rows completely */ HBITMAP hButtonBitmap; /* Scroll Button bitmap */ LPVOID lpTabData; /* Data/Dialog associated with active tab */ HWND hwndSubDlg; /* Subdialog associated with active tab */ HWND hwndFrame; /* Frame, used as client area */ short fToolTips; /* Tooltips wanted */ short fDropText; /* drop text if it doesn't fit*/ short fCondScrollButtons; /* conditional scroll buttons*/ short buttonStyle; /* scroll button style */ short fEllipse; /* truncate text with '...' */ short fFlyby; /* Flyby highlighting */ short fUseClientAreaColor; /* use client area colors in partially obscured frames */ short fScrollOnLeft; /* scroll buttons on left side */ short rowIndent; /* row indentation */ short fNoTruncatePattern; /* don't show truncated pattern for clipped tab */ short fButtonFullSize; /* Scroll buttons as large as tabs */ // the following inserted fields have rendered 4.0 incompatible with 3.5 short fAllowThemes; /* Allow themes WinXP*/ short fUseExactRegion; /* Use exact window region */ short fAlwaysShowAccel; /* always show _ */ DWORD defaultAnimationTimeShow; /* # of milliseconds for animation */ DWORD defaultAnimationStyleShow; /* type of animation */ DWORD defaultAnimationTimeHide; /* not supported */ DWORD defaultAnimationStyleHide; /* not supported */ // the following inserted fields have rendered 4.5 incompatible with 4.0 HBITMAP hButtonBitmapDisabled; /* Scroll Button bitmap (disabled images) */ BOOL fShowFocusRectangle; /* Show the focus rectangle if the control has i/p focus */ // the following inserted fields have rendered 5.0 incompatible with 4.5 short fClosable; // TRUE if Close button wanted short fCloseDisabled; // TRUE if Close button disabled short fSendWMCLOSE; // TRUE if WM_CLOSE message wanted short fCloseFullSize; // TRUE if Close button is full size short buttonAlignment; // Scroll button alignment short closeButtonAlignment; // Close button alignment short fMinimizeButton; // Minimize button wanted short fMinimizeDisabled; // TRUE if Minimize button disabled short fRestoreButton; // Restore button wanted short fRestoreDisabled; // TRUE if Restore button disabled HBITMAP hButtonBitmap2; /* Close, Minimize, Restore button bitmap */ HBITMAP hButtonBitmap2Disabled; /* Close, Minimize, Restore button bitmap (disabled images) */ TCHAR szLeftToolTip[80], szRightToolTip[80], szCloseToolTip[80], szMinimizeToolTip[80], szRestoreToolTip[80]; // tooltips long nCustomCode; // custom modifications // the following inserted fields have rendered 6.0 incompatible with 5.0 int forcedSize; // forced height/width depending on tab style - 0 to ignore BOOL fSwitchOnRelease; // switch tabs on button release (or down if FALSE) BOOL fCompatibleRendering; // Rendering compatible with pre-6.0 BOOL fNoBorder; // don't display clientarea border - select styles only // the following inserted fields have rendered 6.5 incompatible with 6.0 */ short tabsAlignment; /* alignment of tabs on a row */ short layoutMode; /* tab layout mode */ short autoFlowMinRows, autoFlowMaxRows; /* minimum, maximum number of rows (layoutMode autoflow) */ BOOL fReorder; /* allow tab reordering */ BOOL fDragDrop; /* allow dragging tabs elsewhere */ // the following inserted fields have rendered 7.0 incompatible with 6.5 int nDarkMode; /* dark mode setting (SFTTABS_DARKMODE_OFF/ON/AUTO) */ int nHighContrastMode; /* high contrast mode setting (SFTTABS_HIGHCONTRAST_OFF/ON/AUTO) */ int imageScaling; /* SFTTABS_IMAGESCALING_ASIS/STRETCH */ int pixelScaling; /* SFTTABS_PIXELSCALING_ASIS/STRETCH */ // end of inserted incompatible area //RFFU /* read/only fields */ int nTabs; /* number of tabs */ RECT ClientRect; /* Area useable by application */ BOOL fLeftButton, fRightButton; /* TRUE if scrolling in that direction possible (if fScrollable) */ int visibleLeftTab; /* leftmost tab in first row (if fScrollable) */ int naturalSize; /* Best height/width depending on tab style */ short fUsingThemes; /* True if actually using themes */ // the following inserted fields have rendered 6.0 incompatible with 5.0 short highlightTabIndex; // tab currently highlighted (flyby highlighting) BOOL fGDIPlus; // TRUE if GDI+ available int lastErrorValue; // last SetControlInfo error value // the following inserted fields have rendered 6.5 incompatible with 6.0 BOOL fThemesActive; /* Windows themes are active */ BOOL fClippedText; /* clipped text present */ BOOL fLabelDropped; /* labels are dropped */ BOOL fScrollDropped; /* scroll buttons are temporarily dropped */ // the following inserted fields have rendered 7.0 incompatible with 6.5 BOOL fDarkModeActive; /* resolved dark mode state (read-only) */ BOOL fHighContrastActive; /* resolved high contrast state (read-only) */ // end of inserted incompatible area //RFFU /* Modifiable run-time fields */ HBITMAP hOutsideBitmap; /* Background bitmap for areas not covered by tabs */ short xOutside, yOutside; /* Offset */ HBITMAP hInsideBitmap; /* Tab control background bitmap */ short xInside, yInside; /* Offset */ HIMAGELIST hImageList; /* default imagelist used for all tabs */ } SFTTABS_CONTROL, * LPSFTTABS_CONTROL; typedef const SFTTABS_CONTROL * LPCSFTTABS_CONTROL; ``` ``` #define SFTTABS_ERR_nRows 100 #define SFTTABS_ERR_leftMargin 101 #define SFTTABS_ERR_rightMargin 102 #define SFTTABS_ERR_nRowTabs_fFixed 103 #define SFTTABS_ERR_fClientArea 104 #define SFTTABS_ERR_fScrollable 105 #define SFTTABS_ERR_hButtonBitmap 106 #define SFTTABS_ERR_hButtonBitmapDisabled 107 #define SFTTABS_ERR_fHideScrollButtons 108 #define SFTTABS_ERR_fMultiline 109 #define SFTTABS_ERR_fCondScrollButtons 110 #define SFTTABS_ERR_fScrollable_fCondScrollButtons_fHideScrollButtons 111 #define SFTTABS_ERR_buttonStyle 112 #define SFTTABS_ERR_fScrollOnLeft 113 #define SFTTABS_ERR_hButtonBitmap2 114 #define SFTTABS_ERR_hButtonBitmap2Disabled 115 #define SFTTABS_ERR_buttonAlignment 116 #define SFTTABS_ERR_closeButtonAlignment 117 #define SFTTABS_ERR_forcedSize 118 #define SFTTABS_ERR_tabsAlignment 119 #define SFTTABS_ERR_layoutMode 120 #define SFTTABS_ERR_autoFlowMinRows 121 #define SFTTABS_ERR_autoFlowMaxRows 122 #define SFTTABS_ERR_nDarkMode 123 #define SFTTABS_ERR_imageScaling 124 #define SFTTABS_ERR_pixelScaling 125 #define SFTTABS_ERR_nHighContrastMode 126 ``` ### Members style The tab control style. This value defines the basic look of the tab control. The [SftTabs/DLL Wizard](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_wizarddesign) should be used to define all values in this structure. The tab style values (SFTTABSSTYLE_*xxx*) can be found in the header file SftTb.h in the directory \Program Files (x86)\Softelvdm\SftTabs DLL 7.0\Include (unless changed during installation). This value can be modified using [SetControlInfo](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_setcontrolinfo). nRows The number of [tab rows](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/pop_tabrows). This value can be modified using SetControlInfo. nRowTabs if *fFixed* is TRUE, *nRowTabs* is used to set the number of tabs per row. If fewer tabs are available than specified in *nRowTabs*, the remainder of each row is left blank (*fFillComplete* == FALSE) or filled with disabled tabs (*fFillComplete* == TRUE), if *fFixed* is FALSE, this field should be set to 0. This value can be modified using SetControlInfo. leftMargin The number of pixels reserved for the left margin. This value can be modified using SetControlInfo. rightMargin The number of pixels reserved for the right margin. This value can be modified using SetControlInfo. fFixed The width of all tabs. If set to TRUE, all tabs will be of the same width (or height for vertical rows). If set to FALSE, tabs will be sized proportionally to their text and picture size and the available space. This value can be modified using SetControlInfo. fClientArea The availability of a [client area](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/pop_clientarea), normally used for pages or Windows controls attached to tabs. If this is set to TRUE, a client area is available. The client area size can be found in *clientRect*. If this field is set to FALSE, a client area is not available. Not all tab styles support a client area. The SftTabs/DLL Wizard can be used to determine which tab styles support a client area. This value can be modified using SetControlInfo. fMultiline TRUE if multiline tab text is available, otherwise FALSE. When this field is TRUE, tab text can contain newline characters ("\r\n") to signal a new line. Not all tab styles support multiline tab text. The SftTabs/DLL Wizard can be used to determine which tab styles support multiline tab text. This value can be modified using SetControlInfo. fDialog TRUE if the tab control is used in a dialog instead of a window. This field determines some of the colors used for the tab control. Setting this field to FALSE and still using the tab control in a dialog doesn't cause any adverse effects. This field only determines the colors used by the tab control. If a tab control will be placed on a [background](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_background) that is not suitable for 3D rendering (usually a gray background), this field should be set to FALSE. The SftTabs/DLL Wizard can be used to determine the effect of this value. This value can be modified using SetControlInfo. If the defined tab control style (see *style) *supports and [uses themes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_using_themes), this value is ignored. fTextOnly TRUE if the tab background colors are used for the tab text only, otherwise the tab background colors (*colorBg* and *colorBgSel* in [SFTTABS_TAB](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/struct_sfttabs_tab)) are used to fill the entire tab. This value can be modified using SetControlInfo. If the defined tab control style supports and uses themes, this value is ignored. fScrollable TRUE if the tab control offers scrollable tabs (and is restricted to one row of tabs). This value can be modified using SetControlInfo. fHideScrollButtons TRUE if the buttons used for tab scrolling are to be made invisible. If the [scroll buttons](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/pop_scrollbutton) are hidden, the only method to scroll the tabs is by using the keyboard interface or under program control. This value can be modified using SetControlInfo. This option has no effect if scrolling is not enabled. fBoldFont TRUE if the tab text of the currently [active tab](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/pop_activetab) should be bold, FALSE if the same font should be used for active and inactive tabs. The tab text font can be set using the Windows WM_SETFONT message. If *fBoldFont* is TRUE and the default font for the tab control is already bold, the weight of the font used for inactive tabs will be reduced. This value can be modified using SetControlInfo. fFillComplete TRUE if the tab control should attempt to fill each tab row completely so the left and right margins are minimized. For fixed width tabs (*fFixed* is TRUE), additional blank, disabled tabs are added, for variable width tabs (*fFixed* is FALSE), the available space is distributed equally among all tabs so they grow (or shrink) proportionally. This value can be modified using SetControlInfo. hButtonBitmap A bitmap handle. The bitmap is used to display the graphics of the left and right (or up and down) scroll buttons. This parameter may be NULL. Default scroll button bitmaps are provided by SftTabs/DLL and can be seen using the SftTabs/DLL Wizard. This value can be modified using SetControlInfo. The bitmap should contain two equal-sized images, arranged horizontally, so the height of the bitmap is the height of a button's bitmap and the width of the supplied bitmap is twice the width of a button's bitmap. The button size is automatically determined based on the bitmap size. The [top, left pixel](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_bitmap_transparency) of each button bitmap must contain the background color. This color will be replaced by the actual window background color when the bitmap is displayed. Sample bitmaps can be found at \Program Files (x86)\Softelvdm\SftTabs DLL 7.0\Bitmaps. If the defined tab control style (see *style) *supports and uses themes and themed scroll buttons are defined (see *buttonStyle*), this value is ignored. lpTabData Stores a pointer, used for the C++ implementation of tabbed dialogs. For C, the member is not used, but reserved. For C++, the pointer points to the C++ object based on [CSftTabsPage](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses). This value can be modified using [SftTabs_SetPageActive](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_setpageactive) or SetControlInfo. hwndSubDlg Stores a window handle, used for the C and C++ implementation of tabbed dialogs. The window handle describes the page attached to the active tab. This value can be modified using [SetTabInfo](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_settabinfo). hwndFrame Stores a window handle used by SftTabs/DLL as client area for pages attached to the tab control. SftTabs/DLL uses this window's 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 the application. The dependent page can be found in *hwndSubDlg*. 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. This value can be modified using [SftTabs_ActivatePage](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_activatepage), SetControlInfo, [CSftTabsDialog::InitializeTabControl](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabsdialog_initializetabcontrol) or [CSftTabsWindowSheet::InitializeTabControl](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabswindowsheet_initializetabcontrol). fToolTips TRUE if the tab control should display [ToolTips](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_tooltips) for tabs, the scroll buttons and the Minimize, Restore and Close buttons. ToolTip text for each tab has to be added using [SetToolTip](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_settooltip). ToolTips for the scroll buttons and the Minimize, Restore and Close buttons are defined using SetControlInfo. This value can be modified using SetControlInfo. fDropText TRUE if the tab control should drop tab labels, if the labels don't fit vertically and/or horizontally. This option should only be used if all tabs have a graphic component. If the tab label of any tab would be clipped, all tabs will drop the tab label temporarily. This is most useful with resizable tab controls where the user could potentially make the tab control very small, so that tab labels would be clipped. This value can be modified using SetControlInfo. fCondScrollButtons TRUE if the tab control should hide the scroll buttons when scrolling isn't possible because all tabs are visible. This is most useful with resizable tab controls where the user could potentially make the tab control very large, so that all tab labels can be displayed. This value can be modified using SetControlInfo. This option has no effect if scrolling is not enabled. buttonStyle The button style to be used for the scroll buttons and Minimize, Restore and Close buttons, if present. *ButtonStyle* can be one of the following values: | | | | --- | --- | | BMBUTTONSTYLE_31 | A legacy button style with a thick button outline. | | BMBUTTONSTYLE_95 | A standard button style with a thin button outline. | | BMBUTTONSTYLE_95_2 | A standard button style. | | BMBUTTONSTYLE_STD | The button style is chosen based on the environment. When themes are active, BMBUTTONSTYLE_THEME_SCROLL is chosen, otherwise BMBUTTONSTYLE_95 is used. | | BMBUTTONSTYLE_THEME_BUTTON | A themed button style. If themes are not active, this style is identical to BMBUTTONSTYLE_95_2. | | BMBUTTONSTYLE_THEME_SCROLL | A themed button style identical to scroll bar buttons and window frame buttons. If themes are not active, this style is identical to BMBUTTONSTYLE_95_2. | | BMBUTTONSTYLE_THEME_SCROLL2 | A themed button style identical to MDI-style buttons. If themes are not active, this style is identical to BMBUTTONSTYLE_95_2. | | BMBUTTONSTYLE_HOVER_BUTTON | This button style is similar to BMBUTTONSTYLE_95_2, but button borders are only visible when the mouse cursor is located above the button. Otherwise, only the button image defined using *hButtonBitmap* or *hButtonBitmapDisabled* is displayed. | This value can be modified using SetControlInfo. fEllipse TRUE if truncated text should display trailing '...'. This is most useful with resizable tab controls where the user could potentially make the tab control so small that tab labels can't be completely displayed and text would be truncated. This value can be modified using SetControlInfo. fFlyby TRUE if a tab's text should be highlighted if the mouse cursor is on the tab. A tab's text will be underlined and the color defined using SFTTABS_TAB, *colorFlybyFg* is used. This value can be modified using SetControlInfo. If the defined tab control style (see style) supports and uses themes, this value should be set to TRUE. fUseClientAreaColor TRUE if a tab's client area color definition (see SFTTABS_TAB, *colorClientArea*) should be used as background color for frames of the tab control. If enabled, the *colorClientArea* specification is used as background color to fill the frame of rows appearing behind the current row. This value can be modified using SetControlInfo. If the defined tab control style (see style) supports and uses themes, this value is ignored. fScrollOnLeft TRUE if the scroll buttons should appear on the left (or top) of the tab control. If FALSE is specified, the scroll buttons appear on the right (or bottom) of the tab control. This value can be modified using SetControlInfo. This option has no effect if scrolling is not enabled. rowIndent Specifies the indentation of rows in pixels. When multiple rows are displayed, they can be "offset" using the *rowIndent* value creating a cascading effect. If -1 is specified, the tab style's built-in indentation is used. Certain tab styles also use the *rowIndent* value for the first row to create a left/right margin. The SftTabs/DLL Wizard can be used to determine the effect *rowIndent* has on various tab styles. This value can be modified using SetControlInfo. fNoTruncatePattern TRUE if truncated tabs should not be displayed using a ragged edge. If FALSE is specified, a ragged edge is displayed to indicate that the tab is truncated. This value can be modified using SetControlInfo. This option has no effect if scrolling is not enabled. fButtonFullSize TRUE if scroll buttons should be the same height (or width) as the tabs in a scrollable tab control. If FALSE is specified, scroll buttons are sized to fit the scroll button bitmap. This value can be modified using SetControlInfo. This option has no effect if scrolling is not enabled. fAllowThemes User interface controls such as SftTabs/DLL adapt to the current theme defined using the Settings app or Control Panel. If a theme is defined, portions of the control can be painted by Windows using the current theme style. By setting *fAllowThemes* to TRUE, SftTabs/DLL will use the defined theme style to render the control. If *fAllowThemes* is set to FALSE, themes are never used. Because rendering portions of the control is performed by Windows, only a few tab styles can support themes. For all other styles, this option is ignored. If Windows themes are used, the *fUsingThemes* value is set to TRUE. This value can be modified using SetControlInfo. fUseExactRegion By setting *fUseExactRegion* to TRUE, the control will define its exact outline using the Windows SetWindowRgn API. This allows the parent window's background to show through the unused portions of the typically non-rectangular shape of the tab control. An application can retrieve the defined Windows region using the Windows SetWindowRgn API. This value can be modified using SetControlInfo. fAlwaysShowAccel The keyboard accelerator prefix character ("_") may be suppressed until the user presses the Alt key. By setting *fAlwaysShowAccel* to TRUE, the prefix character is always displayed. Otherwise, the prefix character is displayed based on the system settings. This value can be modified using SetControlInfo. defaultAnimationTimeShow Defines the default transition effect when displaying any of the tab pages attached to this tab. Defines the amount of time to be used for the transition effect. Individual tabs can override this default using SFTTABS_TAB, *animateTimeShow*. This value can be modified using SetControlInfo. Use any of the following values: | | | | --- | --- | | 0 | No default transition effect. | | *milliseconds* | The default amount of elapsed time to be used for the transition effect, in milliseconds. | defaultAnimationStyleShow Defines the default visual transition effect. This value is ignored if defaultAnimationTimeShow is not a positive number defining an elapsed time. Individual tabs can override this default using SFTTABS_TAB, *animateStyleShow*. This value can be modified using SetControlInfo. Use one of the following values: | | | | --- | --- | | SFTTABS_ROLL_FROM_LEFT | Rolls the page into view, starting at the left edge. | | SFTTABS_ROLL_FROM_RIGHT | Rolls the page into view, starting at the right edge. | | SFTTABS_ROLL_FROM_TOP | Rolls the page into view, starting at the top edge. | | SFTTABS_ROLL_FROM_BOTTOM | Rolls the page into view, starting at the bottom edge. | | SFTTABS_SLIDE_FROM_LEFT | Slides the page into view, starting at the left edge. | | SFTTABS_SLIDE_FROM_RIGHT | Slides the page into view, starting at the right edge. | | SFTTABS_SLIDE_FROM_TOP | Slides the page into view, starting at the top edge. | | SFTTABS_SLIDE_FROM_BOTTOM | Slides the page into view, starting at the bottom edge. | | SFTTABS_EXPAND_CENTER | Displays the page, expanding it from the center outwards. | defaultAnimationTimeHide Reserved for future use. Must be initialized to 0. defaultAnimationStyleHide Reserved for future use. Must be initialized to 0. hButtonBitmapDisabled A bitmap handle. The bitmap is used to display the graphics of the left and right (or up and down) scroll buttons, when the button is disabled. This parameter may be NULL, in which case the bitmap defined using *hButtonBitmap* is used to create a grayed bitmap representing a disabled button image. This value can be modified using SetControlInfo. The bitmap should contain two equal-sized images, arranged horizontally, so the height of the bitmap is the height of a button's bitmap and the width of the supplied bitmap is twice the width of a button's bitmap. The button size is automatically determined based on the bitmap size. The top, left pixel of each button bitmap must contain the background color. This color will be replaced by the actual window background color when the bitmap is displayed. Sample bitmaps can be found at \Program Files (x86)\Softelvdm\SftTabs DLL 7.0\Bitmaps. If the defined tab control style (see *style) *supports and uses themes and themed scroll buttons are defined (see *buttonStyle*), this value is ignored. fShowFocusRectangle TRUE if the tab control displays a focus rectangle around the text of the tab label, when the control has the input focus. If FALSE is specified, the control never displays a focus rectangle. This value can be modified using SetControlInfo. fClosable TRUE if the tab control displays a Close button. If FALSE is specified, the control doesn't display a Close button. The Close button generates [SFTTABSN_CLOSEBUTTON](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) notifications or [WM_CLOSE](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_windows_messages) message, based on the *fSendWMCLOSE* member settings. This value can be modified using SetControlInfo. fCloseDisabled TRUE if the Close button is disabled. If FALSE is specified, the Close button is enabled. If the Close button is disabled, no notifications or messages are generated when the user clicks the Close button. This option has no effect if the Close button is not available. This value can be modified using SetControlInfo. fSendWMCLOSE TRUE if the Close button generates a WM_CLOSE message. If FALSE is specified, the Close button generates SFTTABSN_CLOSEBUTTON notifications. This option has no effect if the Close button is not available. This value can be modified using SetControlInfo. fCloseFullSize TRUE if the Minimize, Restore and Close buttons should be the same height (or width) as the tabs in the tab control. If FALSE is specified, buttons are sized to fit the button bitmaps. This option has no effect if the Close button is not available. This value can be modified using SetControlInfo. buttonAlignment The alignment to be used for the scroll buttons, if present. This value can be modified using SetControlInfo.* buttonAlignment* can be one of the following values: | | | | --- | --- | | SFTTABS_BUTTON_NEAR | The scroll buttons appear near the tab control's visible border (touching the border of the tab page). | | SFTTABS_BUTTON_CENTER | The scroll buttons appear centered within the tab control's visible border and the outside edge of the tab control window. | | SFTTABS_BUTTON_FAR | The scroll buttons appear aligned with the outside edge of the tab control window. | This value can be modified using SetControlInfo. closeButtonAlignment The alignment to be used for the Minimize, Restore and Close buttons, if present. This value can be modified using SetControlInfo.* closeButtonAlignment* can be one of the following values: | | | | --- | --- | | SFTTABS_BUTTON_NEAR | The buttons appear near the tab control's visible border (touching the border of the tab page). | | SFTTABS_BUTTON_CENTER | The buttons appear centered within the tab control's visible border and the outside edge of the tab control window. | | SFTTABS_BUTTON_FAR | The buttons appear aligned with the outside edge of the tab control window. | This value can be modified using SetControlInfo. fMinimizeButton TRUE if the tab control displays a Minimize button. If FALSE is specified, the control doesn't display a Minimize button. The Minimize button generates SFTTABSN_MINIMIZEBUTTON notifications. This value can be modified using SetControlInfo. fMinimizeDisabled TRUE if the Minimize button is disabled. If FALSE is specified, the Minimize button is enabled. If the Minimize button is disabled, no notifications are generated when the user clicks the Minimize button. This option has no effect if the Minimize button is not available. This value can be modified using SetControlInfo. fRestoreButton TRUE if the tab control displays a Restore button. If FALSE is specified, the control doesn't display a Restore button. The Restore button generates SFTTABSN_RESTOREBUTTON notifications. This value can be modified using SetControlInfo. fRestoreDisabled TRUE if the Restore button is disabled. If FALSE is specified, the Restore button is enabled. If the Restore button is disabled, no notifications are generated when the user clicks the Restore button. This option has no effect if the Restore button is not available. This value can be modified using SetControlInfo. hButtonBitmap2 A bitmap handle. The bitmap is used to display the graphics of the enabled Minimize, Restore, Close buttons. This parameter may be NULL. Default Minimize, Restore, Close buttons bitmaps are provided by SftTabs/DLL and can be seen using the SftTabs/DLL Wizard. This value can be modified using SetControlInfo. The bitmap should contain three equal-sized images, arranged horizontally, so the height of the bitmap is the height of a button's bitmap and the width of the supplied bitmap is three times the width of a button's bitmap. The button size is automatically determined based on the bitmap size. The top, left pixel of each button bitmap must contain the background color. This color will be replaced by the actual window background color when the bitmap is displayed. Sample bitmaps can be found at \Program Files (x86)\Softelvdm\SftTabs DLL 7.0\Bitmaps. If the defined tab control style (see *style) *supports and uses themes and themed scroll buttons are defined (see *buttonStyle*), this value is ignored. hButtonBitmap2Disabled A bitmap handle. The bitmap is used to display the graphics of the disabled Minimize, Restore, Close buttons. This parameter may be NULL. Default Minimize, Restore, Close buttons bitmaps are provided by SftTabs/DLL and can be seen using the SftTabs/DLL Wizard. This value can be modified using SetControlInfo. The bitmap should contain three equal-sized images, arranged horizontally, so the height of the bitmap is the height of a button's bitmap and the width of the supplied bitmap is three times the width of a button's bitmap. The button size is automatically determined based on the bitmap size. The top, left pixel of each button bitmap must contain the background color. This color will be replaced by the actual window background color when the bitmap is displayed. Sample bitmaps can be found at \Program Files (x86)\Softelvdm\SftTabs DLL 7.0\Bitmaps. If the defined tab control style (see *style) *supports and uses themes and themed scroll buttons are defined (see *buttonStyle*), this value is ignored. szLeftToolTip Defines the ToolTip displayed by the left/up scroll button. This value can be modified using SetControlInfo. szRightToolTip Defines the ToolTip displayed by the right/down scroll button. This value can be modified using SetControlInfo. szCloseToolTip Defines the ToolTip displayed by the Close button. This value can be modified using SetControlInfo. szMinimizeToolTip Defines the ToolTip displayed by the Minimize button. This value can be modified using SetControlInfo. szRestoreToolTip Defines the ToolTip displayed by the Restore button. This value can be modified using SetControlInfo. nCustomCode Defines optional product customization. Valid values are made available by [Product Support](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_contactsoftel), in response to purchased enhancements, special features, etc. and are only available upon request. This value can be modified using SetControlInfo. forcedSize Defines the height/width of one tab row, in pixels. Set to 0 to let the control calculate the optimal height/width. The forcedSize member defines the height of a tab row in a horizontal tab control and the width in a vertical tab control. This value can be modified using SetControlInfo. The forcedSize member can be used to specify the exact height of a row to align the control with other controls on the same dialog. fSwitchOnRelease Defines whether tab switching occurs as the user presses or releases the mouse button on a tab. Set to TRUE to switch tabs as the user releases the mouse button, otherwise set to FALSE to switch tabs as soon as the user presses the mouse button. This value can be modified using SetControlInfo. fCompatibleRendering Defines whether the tab control is internally processed as in earlier releases (pre-6.0) or using a new, even smoother, but more resource intensive method. Set to TRUE to use the old method, otherwise FALSE to use the new method. This value can be modified using SetControlInfo. The control automatically uses a suitable default for fCompatibleRendering. On all supported Windows versions, this member defaults to FALSE. fNoBorder Defines whether the tab page border is suppressed. Set to TRUE to suppress the tab page border from being painted, otherwise FALSE. This value can be modified using SetControlInfo. This member is only used for the button tab styles (SFTTABSSTYLE_BUTTONS_xxx). tabsAlignment Defines the alignment of tabs within rows. *tabsAlignment* can be one of the following values: | | | | --- | --- | | SFTTABS_TABS_LEFT | The tabs are left aligned (or top aligned when tab rows are vertical). | | SFTTABS_TABS_RIGHT | The tabs are right aligned (or bottom aligned when tab rows are vertical). | This value can be modified using SetControlInfo. layoutMode Defines the distribution of tabs within the tab rows. *layoutMode* can be one of the following values: | | | | --- | --- | | SFTTABS_LAYOUT_DISTRIBUTE | The tabs are distributed equally within all available rows. | | SFTTABS_LAYOUT_FLOW | Rows are filled with tabs (front first) without truncating or dropping tab labels until all available rows defined using *nRows* are filled. If insufficient space is available, some tabs labels may still be dropped or truncated. | | SFTTABS_LAYOUT_AUTOFLOW | Rows are filled with tabs (front first) without truncating or dropping tab labels and the required number of rows is automatically determined. If insufficient space is available, some tabs labels may still be dropped or truncated. The members *autoFlowMinRows* and *autoFlowMaxRows* are used to determine the minimum and maximum number of rows allowed when distributing tabs. | This value can be modified using SetControlInfo. autoFlowMinRows Defines the minimum number of rows required when distributing tabs (*layoutMode* == SFTTABS_LAYOUT_AUTOFLOW only). This value can be modified using SetControlInfo. autoFlowMaxRows Defines the maximum number of rows allowed when distributing tabs (*layoutMode* == SFTTABS_LAYOUT_AUTOFLOW only). This value can be modified using SetControlInfo. fReorder Defines whether tab reordering is enabled. Set to TRUE to enable tab reordering, otherwise FALSE. Tab reordering is only available for tab controls with one row of tabs (see nRows). This value can be modified using SetControlInfo. fDragDrop Defines whether drag & drop is enabled. Set to TRUE to enable drag & drop, otherwise FALSE. This value can be modified using SetControlInfo. nTabs The currently defined number of tabs. This value cannot be modified. Use [AddTab](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_addtab), [InsertTab](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_inserttab) or [DeleteTab](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_deletetab) instead. ClientRect The location of the client area in tab control coordinates, where the top left corner of the tab control is at 0,0. If *fClientArea* is FALSE (no client area is present), an empty rectangle is returned. This value cannot be modified. fLeftButton TRUE if the tab control supports scrolling and scrolling left (or up in a vertical tab control) is currently possible. This member can be used when an application provides its own scrolling mechanism, to query the tab control if scrolling is possible in this direction. This value cannot be modified. fRightButton TRUE if the tab control supports scrolling and scrolling right (or down in a vertical tab control) is currently possible. This member can be used when an application provides its own scrolling mechanism to query the tab control if scrolling is possible in this direction. This value cannot be modified. visibleLeftTab The index of the leftmost tab (or topmost in a vertical tab control) currently visible in a scrollable tab control. This value cannot be modified. naturalSize The ideal height of a tab control (or width of a vertical tab control). This field is only valid for tab controls that do not offer a client area (*fClientArea* == FALSE). This value can be used to determine the best height for a tab control with horizontal tab rows (or width for vertical rows). This value cannot be modified. fUsingThemes TRUE if the control is currently rendered using Windows themes (*fAllowThemes* is set to TRUE and the current theme supports it). This value cannot be modified. highlightTabIndex The index of the tab currently highlighted (hot) due to [flyby highlighting](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_flyby_highlighting) or -1 if no tab is highlighted. This value cannot be modified. fGDIPlus TRUE if the current application supports [GDI+](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_gdiplus), otherwise FALSE. SftTabs/DLL automatically determines whether the application has GDI+ features available, so an application can use suitable tab pictures. This value cannot be modified. lastErrorValue Contains the value of the last error that occurred when SetControlInfo was called. This value must be retrieved after a call to SetControlInfo using the [GetControlInfo](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_getcontrolinfo) function. The error value is **not** returned by the call to SetControlInfo. Error codes are listed at the top of this page, along with their preprocessor symbol name. Each error code is named SFTTABS_ERR_, followed by the member (field) name that caused the error. fThemesActive TRUE if Windows themes are active for this application, FALSE otherwise. fClippedText TRUE if any of the tab labels have been clipped because there is insufficient space to display the entire tab label, otherwise FALSE, indicating that all tab labels are completely visible. This value cannot be modified. fLabelDropped TRUE if the tab labels have been dropped because there is insufficient space to display the tab labels, otherwise FALSE, indicating that all tab labels are shown. This value cannot be modified. Tab labels may be dropped if the *fDropText* member is set to TRUE. fScrollDropped TRUE if the scroll buttons have been dropped because scrolling is not possible (all tabs are shown), otherwise FALSE. This value cannot be modified. Scroll buttons may be dropped if the *fCondScrollButtons* member is set to TRUE. hOutsideBitmap A bitmap handle describing the bitmap used as the background of the area not covered by tabs, tab frames or the tab client area. Any reasonable size bitmap can be used. If the background bitmap is too small to fill the entire area of the tab control, it is tiled. Specify NULL to stop using a background bitmap. The bitmap specified is aligned with the top/left corner of the tab control window, unless the alignment is changed using *xOutside* and *yOutside*. This value can be modified using SetControlInfo. If the tab control uses an exact window region (see *fUseExactRegion*), this value is ignored and a background bitmap is not available. If the defined tab control style (see style) supports and uses themes, this value is ignored and a background bitmap is not available. xOutside, yOutside Specifies the x and y alignment offset of the background bitmap (*hOutsideBitmap*). The value specified must be greater than or equal to 0. If 0 is specified, the bitmap is aligned with the top/left corner of the tab control window. This value can be modified using SetControlInfo. If the defined tab control style (see *style) *supports and uses themes, this value is ignored and a background bitmap is not available. hInsideBitmap A bitmap handle describing the bitmap used as the background of the tab control. This background bitmap is used for all tabs and tab frames. It is not used for the background outside of the tabs or client area. The background bitmap is not visible in the client area if child windows or child dialogs use the client area, which is normally the case in tabbed dialogs or windows. However, tabbed dialogs will automatically use this bitmap as background bitmap for the tab page (see Background). Any reasonable size bitmap can be used. If the background bitmap is too small to fill the entire area of the tab control, it is tiled. Specify NULL to stop using a background bitmap. The bitmap specified is aligned with the top/left corner of the tab control window, unless the alignment is changed using *xInside* and *yInside*. This value can be modified using SetControlInfo. If the defined tab control style (see *style) *supports and uses themes, this value is ignored and a background bitmap is not available. xInside, yInside Specifies the x and y alignment offset of the background bitmap (*hInsideBitmap*). The value specified must be greater than or equal to 0. If 0 is specified, the bitmap is aligned with the top/left corner of the tab control window. This value can be modified using SetControlInfo. If the defined tab control style (see *style) *supports and uses themes, this value is ignored and a background bitmap is not available. hImageList Defines the default ImageList control to be used for tab pictures, defined using [SFTTABS_GRAPH](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/struct_sfttabs_graph). When adding or inserting tabs, the picture index is defined using the SFTTABS_TAB structure. Individual tabs can override the default ImageList using SetTabInfo (SFTTABS_TAB, hImageList). This value can be modified using SetControlInfo. nDarkMode Defines the tab control's [dark mode](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_darkmode) setting. One of [SFTTABS_DARKMODE_OFF](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_darkmode) (always light, default), SFTTABS_DARKMODE_ON (always dark) or SFTTABS_DARKMODE_AUTO (follow the Windows "Choose your mode" setting). See SetDarkMode. This value can be modified using SetControlInfo. nHighContrastMode Defines the tab control's [high contrast mode](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_highcontrast) setting. One of [SFTTABS_HIGHCONTRAST_OFF](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_highcontrast), SFTTABS_HIGHCONTRAST_ON, or SFTTABS_HIGHCONTRAST_AUTO (default - follow the Windows High Contrast [accessibility](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_accessibility) setting). See SetHighContrastMode. This value can be modified using SetControlInfo. imageScaling Defines how images drawn by the tab control (tab pictures, scroll button bitmaps, close/minimize/restore button bitmaps) are scaled relative to the current monitor DPI. One of [SFTTABS_IMAGESCALING_ASIS](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_imagescaling) (native pixel size, default) or SFTTABS_IMAGESCALING_STRETCH (scaled by *currentDPI / 96*). See SetImageScaling. This value can be modified using SetControlInfo. pixelScaling Defines how caller-supplied pixel dimensions (*leftMargin*, *rightMargin*, *rowIndent*, *forcedSize*) are interpreted relative to the current monitor DPI. One of [SFTTABS_PIXELSCALING_ASIS](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_pixelscaling) (physical pixels, default) or SFTTABS_PIXELSCALING_STRETCH (96-DPI reference pixels scaled at use time). See SetPixelScaling. Stored values always remain in caller-reference units. This value can be modified using SetControlInfo. fDarkModeActive Read-only. TRUE if the tab control is currently rendering with the dark color palette, otherwise FALSE. Reflects the resolved state after applying the *nDarkMode* setting and, when AUTO, the Windows "Choose your mode" system setting. fHighContrastActive Read-only. TRUE if Windows High Contrast rendering is currently in effect on the tab control, otherwise FALSE. Reflects the resolved state after applying the *nHighContrastMode* setting and, when AUTO, the Windows High Contrast accessibility setting. ### Comments The SFTTABS_CONTROL structure is used to describe a tab control's layout and attributes. The SFTTABS_CONTROL structure can be defined using the SftTabs/DLL Wizard. While it is possible to specify a background bitmaps for a tab control using the SFTTABS_CONTROL structure members *hOutsideBitmap* and *hInsideBitmap*, these bitmaps, particularly the client area portion, are only visible if the tab control is not obscured by other windows. A dialog page or window attached to a tab will of course cover the client area and the background bitmap is not visible. The [SftTabs_PaintTiledBitmap](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_painttiledbitmap) function can be used to paint a tiled bitmap on a window. When using a background bitmap on a dialog, please note that the standard controls such as check boxes, static text controls, etc. do **not** allow the background bitmap to be visible (they are not transparent). Some third party controls do allow a transparent display, however, this is not a part of the product SftTabs/DLL. ### Example This example changes the number of tab rows. C ``` SFTTABS_CONTROL Ctl; SftTabs_GetControlInfo(hwndTab, &Ctl); Ctl.nRows = 1; SftTabs_SetControlInfo(hwndTab, &Ctl); ``` C++ ``` SFTTABS_CONTROL Ctl; m_Tab.GetControlInfo(&Ctl); Ctl.nRows = 1; m_Tab.SetControlInfo(&Ctl); ``` See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | C++ Classes | Notifications ## SFTTABS_DRAGINFO Structure *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/struct_sfttabs_draginfo* The SFTTABS_DRAGINFO structure is used with [GetDragInfo](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_getdraginfo)/[SetDragInfo](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_setdraginfo) during tab reordering and drag & drop. ``` typedef struct tagTabsDragInfo { // drag & drop information HWND targetWindow; // target window BOOL targetIsTabControl; // TRUE if target window is a tab control int targetTab; // insertion point (for tab control only) POINT targetCursorPoint; // last cursor position (in targetWindow client coordinates) BOOL targetAllowed; // TRUE if target window is allowed as drop target HWND sourceWindow; // source window for drag&drop int reorderTab; // tab being dragged (from sourceWindow) POINT reorderPt; // where mouse button was initially clicked (in sourceWindow client coordinates) } SFTTABS_DRAGINFO, * LPSFTTABS_DRAGINFO; typedef const SFTTABS_DRAGINFO * LPCSFTTABS_DRAGINFO; ``` ### Members targetWindow Defines the target window, currently located at the mouse cursor position. targetIsTabControl If the target window, currently located at the mouse cursor position, is a SftTabs/DLL tab control, the value is TRUE, FALSE otherwise. targetTab If the current target window is a SftTabs/DLL tab control, this member defines the current zero-based insertion point for the tab being moved. targetCursorPoint Defines the mouse cursor position in client coordinates within the target window *targetWindow*. targetAllowed Defines whether the current target is an allowable drop target. Set to TRUE to allow the tab to be dropped at the current position (defined by *targetWindow*, *targetTab*), FALSE otherwise. When modifying the *targetAllowed* member, the SetDragInfo function must be called. This is only possible while handling a [SFTTABSN_DRAGMOVE](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) event to signal whether the current target is an allowable drop target. sourceWindow Defines the source window (always a SftTabs/DLL control) where the drag & drop operation started. reorderTab Defines the zero-based tab within the source window (tab control) *sourceWindow* where the drag & drop operation originated. reorderPt Defines the coordinates (in client area coordinates) within the source window (tab control) *sourceWindow* where the drag & drop operation originated. ### Comments The SFTTABS_DRAGINFO structure is used with GetDragInfo/SetDragInfo during tab reordering and drag & drop. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | Notifications ## SFTTABS_DRAWBACKGROUNDPROC Type Definition *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/typedef_sfttabs_drawbackgroundproc* Defines the type of a user-supplied drawing callback routine called by SftTabs/DLL, which paints the tab page [background](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_background). ``` typedef void (CALLBACK* SFTTABS_DRAWBACKGROUNDPROC)(HDC hDC, HWND hwndDlg, HWND hwndTab, SFTTABS_DWORD_PTR UserData); ``` ### Parameters hDC The device context used to paint the tab page background. hwndDlg The window handle of the dialog representing the tab page. hwndTab The window handle of the tab control containing the tab page. UserData An application specific value as supplied using [SftTabs_TransparentControls](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_transparentcontrols) or [CSftTabsPage::m_lpfnDrawBackground](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabspage_m_lpfndrawbackground). ### Comments SFTTABS_DRAWBACKGROUNDPROC defines the type of a user-supplied drawing callback routine called by SftTabs/DLL, which paints the tab page background. The background drawing callback is defined using SftTabs_TransparentControls (C) or CSftTabsPage::m_lpfnDrawBackground (C++/MFC). It is called by SftTabs/DLL to allow the application to display a custom tab page background. The callback function can retrieve tab control and tab settings, but no modifications should be made to the tab control in any way. > Backgrounds require Common Controls version 6. Background colors based on [SFTTABS_TAB](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/struct_sfttabs_tab), * colorClientArea* are supported in all environments. ### 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); } ``` C++ ``` CSamplePage::CSamplePage(CWnd* pParent /*=NULL*/) : CSftTabsPage(CSamplePage::IDD, pParent) { m_lpfnDrawBackground = SamplePage_DrawBackground; m_flagDrawBackground = SFTTABS_DRAWBG_OVERRIDETHEME; m_UserDataBackground = (SFTTABS_DWORD_PTR)this; m_BackgroundBitmap.LoadBitmap(IDB_BACKGROUND); } void CALLBACK SamplePage_DrawBackground(HDC hDC, HWND hwndDlg, HWND hwndTab, SFTTABS_DWORD_PTR UserData) { CSamplePage* pThis = (CSamplePage*)UserData; RECT rect; GetClientRect(hwndDlg, &rect); SftTabs_PaintTiledBitmap(hDC, pThis->m_BackgroundBitmap, 0, 0, &rect); } ``` See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## SFTTABS_DRAWINFO Structure *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/struct_sfttabs_drawinfo* The SFTTABS_DRAWINFO structure is passed to an application defined callback routine which can calculate the size or paint the tab labels. ``` typedef struct tagTabsDrawInfo { #define SFTTABS_DI_CALC 0 #define SFTTABS_DI_PAINT 1 int style; // callback function HDC hDC; // device context RECT DrawRect; // Drawing rectangle HFONT hFont; // suggested font HFONT hFontNorm; // tab control font HFONT hFontBold; // tab control font for bold tabs HFONT hFontBoldUL; // tab control font for bold tabs, underlined for flyby highlighting HFONT hFontNormUL; // tab control font, underlined for flyby highlighting int gap; // suggested gap size BOOL fTextDropped; // Tab text should be dropped int topTabs; // dual tabs, number of tabs on top/left BOOL fActive; // tab is the active tab BOOL fHighlight; // flyby highlighting for tab BOOL fFocus; // tab has focus COLORREF colorBg; // background color COLORREF colorFg; // foreground color COLORREF color1; // usually used for black border COLORREF color2; // usually used for shadow lines COLORREF color3; // usually used for highlight lines COLORREF color4; // usually used for somewhat highlighted lines // new in 6.0 RECT AvailableRect;// available (maximum) area or empty to calc best fit int iRealTab; // real tab index BOOL fShowAccel; // TRUE if kbd.accell (underscore) is to be displayed // new in 7.0 int dpi; // effective DPI for this paint (per-monitor v2) SFTTABS_DWORD_PTR res2;// reserved SFTTABS_DWORD_PTR res3;// reserved SFTTABS_DWORD_PTR res4;// reserved SFTTABS_DWORD_PTR res5;// reserved SFTTABS_DWORD_PTR res6;// reserved SFTTABS_DWORD_PTR res7;// reserved SFTTABS_DWORD_PTR res8;// reserved } SFTTABS_DRAWINFO, * LPSFTTABS_DRAWINFO; typedef const SFTTABS_DRAWINFO * LPCSFTTABS_DRAWINFO; ``` ### Members style The *style* member indicates the purpose of the current call to the drawing callback routine. *style* can be one of the following values: SFTTABS_DI_CALC - The callback is called to determine the required size of the tab label. The *DrawRect* member must be updated to reflect the tab label size (in pixels). No other fields of this structure should be modified. SFTTABS_DI_PAINT - The callback is called to paint the tab label at the coordinates described by the *DrawRect* member. Painting must occur within the boundaries of *DrawRect*. There is no automatic clipping if the application draws outside of the given area. No other fields of this structure should be modified. Additional values - Reserved for future used. hDC The device context used to calculate or paint the tab label. DrawRect If the *style* member indicates that the callback should provide the dimensions of the tab label (SFTTABS_DI_CALC), the *DrawRect* member must be updated by the callback with the calculated size of the tab label. If an empty rectangle is returned, the drawing callback will not be called to paint the tab label and the tab is painted by the tab control. If the *style* member indicates that the callback should paint the tab label (SFTTABS_DI_PAINT), the *DrawRect* member contains the coordinates of the tab label. hFont The suggested font for the tab label. This font is derived from the tab control's font (defined using WM_SETFONT or CWnd::SetFont) and is rotated if necessary (for vertical tabs) and is bold (if the tab is the [current tab](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/pop_activetab) and the [SFTTABS_CONTROL](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/struct_sfttabs_control) structure defines *fBoldFont* as TRUE) and has the underline attribute (if the tab is the target of [flyby highlighting](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_flyby_highlighting)). hFontNorm The tab control's default font. It is defined using WM_SETFONT or CWnd::SetFont and is rotated if necessary (for vertical tabs). hFontBold A font derived from the tab control's default font (defined using WM_SETFONT or CWnd::SetFont). It is rotated if necessary (for vertical tabs) and has the bold attribute. hFontBoldUL A font derived from the tab control's default font (defined using WM_SETFONT or CWnd::SetFont). It is rotated if necessary (for vertical tabs) and has the bold and underline attributes. hFontNormUL A font derived from the tab control's default font (defined using WM_SETFONT or CWnd::SetFont). It is rotated if necessary (for vertical tabs) and has the underline attribute. gap The suggested gap size (in pixels) to separate picture and text components. fTextDropped If the *fDropText* member of the SFTTABS_CONTROL structure is set to TRUE, the tab control may drop the tab text for all tabs. If tab text has been dropped, the *fTextDropped* member is set to TRUE, otherwise it is FALSE. topTabs Defines the number of tabs on top (left) in a dual tab control. fActive TRUE indicates that the tab is the current tab, otherwise *fActive* is FALSE. fHighlight TRUE indicates that the tab is the target of flyby highlighting, otherwise *fHighlight* is FALSE. fFocus TRUE indicates that the tab is the current tab and that the tab control has the input focus, otherwise *fFocus* is FALSE. colorBg The [background](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_background) color of the tab control. The color provided here is merely a suggested color. It is not necessary to use this color. colorFg The foreground color of the tab control. The color provided here is merely a suggested color. It is not necessary to use this color. color1 The color used to draw the lines indicating the tab control border. The color provided here is merely a suggested color. It is not necessary to use this color. color2 The color used to draw the lines away from the light source, indicating a shadow. The color provided here is merely a suggested color. It is not necessary to use this color. color3 The color used to draw the lines directly exposed to the light source, indicating a highlight. The color provided here is merely a suggested color. It is not necessary to use this color. color4 The color used to draw the lines somewhat exposed to the light source. The color provided here is merely a suggested color. It is not necessary to use this color. AvailableRect If the *style* member indicates that the callback should provide the dimensions of the tab label (SFTTABS_DI_CALC), the *AvailableRect* member contains the maximum available area for the tab contents. *AvailableRect* may be empty, in which case there is no space restriction. The callback provides the exact size (preferably smaller or equal to *AvailableRect*) in the *DrawRect* member. If the *style* member indicates that the callback should paint the tab label (SFTTABS_DI_PAINT), the *AvailableRect *member is not used. iRealTab The tab index of the tab, for which the callback is called. This is not necessarily the same index as the *iTab* argument of the callback [SFTTABS_DRAWTABPROC](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/typedef_sfttabs_drawtabproc). The *iTab* argument does not take hidden tabs into account, so it cannot be used when hidden tabs are present. *iRealTab* should be used exclusively. fShowAccel TRUE if keyboard accelerators (underlined keyboard shortcuts in tab labels) are currently displayed, otherwise FALSE. dpi The effective DPI (dots-per-inch) for the monitor the tab control is currently displayed on. 96 represents 100% scaling, 144 represents 150%, 192 represents 200%. Owner-draw code should read this value on every paint and must not cache pixel metrics across callbacks. See [GetDPI](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_dpi). ### Comments The SFTTABS_DRAWINFO structure is passed to an application defined callback routine which can calculate the size or paint the tab labels. A drawing callback is defined using [SetDrawTabCallback](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_setdrawtabcallback). Tab controls calculate the size of each tab based on tab control settings (defined using SFTTABS_CONTROL and [SFTTABS_TAB](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/struct_sfttabs_tab) structures). When a drawing callback is used, the callback is used to determine the required size of the tab label (*DrawRect*). In this case, the callback is called and a *style* value of SFTTABS_DI_CALC is passed. If an empty rectangle is returned, the drawing callback will not be called to paint the tab label and the tab is painted by the tab control. The callback may be called multiple times to determine the tab size, before and after tabs are painted. When a drawing callback is called to paint a tab, a *style* value of SFTTABS_DI_PAINT is passed. The callback can then paint the tab label in the area described by *DrawRect*. ### Example C++ ``` void CSampleDlg::DrawOneTab(int iTab, LPSFTTABS_DRAWINFO lpDrawInfo) { if (iTab == 1) { /* only handle the second tab */ SFTTABS_TAB Tab; // get tab attributes m_Tab.GetTabInfo(iTab, &Tab); CDC dc; dc.Attach(lpDrawInfo->hDC); switch (lpDrawInfo->style) { case SFTTABS_DI_CALC: { // calculate the size of the label CFont* tFont = (CFont*) dc.SelectObject(lpDrawInfo->hFont); dc.DrawText(Tab.lpszText, -1, &lpDrawInfo->DrawRect, DT_CALCRECT|DT_SINGLELINE); // allow extra space for border ::InflateRect(&lpDrawInfo->DrawRect, 2, 2); break; } case SFTTABS_DI_PAINT: { // paint label CBrush brFill, brFrame; COLORREF color; int mode; // select the background color as defined for the tab if (lpDrawInfo->fActive) color = Tab.colorBgSel; else color = Tab.colorBg; // translate to real color (if using system colors) or use default // tab control color if no tab color defined color = TrColor(color, RGB(255,255,255)); // or lpDrawInfo->colorBg // If the tab control has the input focus, use a solid background if (lpDrawInfo->fFocus) brFill.CreateSolidBrush(color); else brFill.CreateHatchBrush(HS_FDIAGONAL, color); dc.FillRect(&lpDrawInfo->DrawRect, &brFill); if (lpDrawInfo->fHighlight) { // use flyby color, because tab is highlighted color = TrColor(Tab.colorFlybyFg, RGB(0,0,128)); brFrame.CreateSolidBrush(color); // draw double frame dc.FrameRect(&lpDrawInfo->DrawRect, &brFrame); ::InflateRect(&lpDrawInfo->DrawRect, -1, -1); dc.FrameRect(&lpDrawInfo->DrawRect, &brFrame); } else { // select the foreground color as defined for the tab if (lpDrawInfo->fActive) color = Tab.colorFgSel; else color = Tab.colorFg; // translate to real color (if using system colors) or use default // tab control color if no tab color defined color = TrColor(color, lpDrawInfo->colorFg); // frame the area brFrame.CreateSolidBrush(TrColor(lpDrawInfo->fActive ? Tab.colorFgSel : Tab.colorFg, lpDrawInfo->colorFg)); dc.FrameRect(&lpDrawInfo->DrawRect, &brFrame); } // Use the foreground color to draw the text if (lpDrawInfo->fActive) color = Tab.colorFgSel; else color = Tab.colorFg; color = TrColor(color, lpDrawInfo->colorFg); ::InflateRect(&lpDrawInfo->DrawRect, -1, -1); CFont* tFont = (CFont*) dc.SelectObject(lpDrawInfo->hFont); mode = dc.SetBkMode(TRANSPARENT); dc.DrawText(Tab.lpszText, -1, &lpDrawInfo->DrawRect, DT_CENTER|DT_VCENTER|DT_SINGLELINE|DT_WORD_ELLIPSIS); dc.SetBkMode(mode); // Draw a focus ring if (lpDrawInfo->fFocus) dc.DrawFocusRect(&lpDrawInfo->DrawRect); break; } } dc.Detach(); } } ``` See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## SFTTABS_DRAWPROCPARM Structure *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/struct_sfttabs_drawprocparm* Used as a parameter for [SetDrawTabCallback](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_setdrawtabcallback) to define an application-specific drawing callback routine, which paints the tab labels. ``` typedef struct tagTabsDrawProcParm { SFTTABS_DRAWTABPROC lpfnDrawProc; /* User supplied drawing callback routine */ SFTTABS_DWORD_PTR UserData; /* User supplied data */ } SFTTABS_DRAWPROCPARM, * LPSFTTABS_DRAWPROCPARM; ``` ### Members lpfnDrawProc A pointer to a drawing callback routine of type [SFTTABS_DRAWTABPROC](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/typedef_sfttabs_drawtabproc), which calculates the tab label size and paints tab labels. UserData An application specific value. This value is passed to the drawing callback (SFTTABS_DRAWTABPROC) as the UserData parameter. ### Comments The SFTTABS_DRAWPROCPARM structure is used as a parameter for SetDrawTabCallback to define an application-specific drawing callback routine, which paints the tab labels. ### Example C++ ``` // Register a drawing callback { SFTTABS_DRAWPROCPARM Parm = { CSampleDlg::DrawOneTabCallback, (SFTTABS_DWORD_PTR)(LPVOID)this // Pass this to callback as UserData }; m_Tab.SetDrawTabCallback(&Parm); } ``` See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## SFTTABS_DRAWTABPROC Type Definition *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/typedef_sfttabs_drawtabproc* Defines the type of a user-supplied drawing callback routine called by SftTabs/DLL, which paints the tab labels. ``` typedef void (CALLBACK* SFTTABS_DRAWTABPROC)(HWND hwnd, int iTab, SFTTABS_DWORD_PTR UserData, LPSFTTABS_DRAWINFO lpDrawInfo); ``` ### Parameters hwnd The window handle of the tab control. iTab The zero-based tab index of the tab label to be calculated or painted. The *iTab* argument does not take hidden tabs into account, so it cannot be used when hidden tabs are present. The *iRealTab* member of the [SFTTABS_DRAWINFO](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/struct_sfttabs_drawinfo) must be used instead. UserData An application specific value as supplied in the [SFTTABS_DRAWPROCPARM](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/struct_sfttabs_drawprocparm) structure. lpDrawInfo A pointer to the SFTTABS_DRAWINFO structure, which contains painting information. ### Comments SFTTABS_DRAWTABPROC defines the type of a user-supplied drawing callback routine called by SftTabs/DLL, which paints the tab labels. A drawing callback is defined using [SetDrawTabCallback](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_setdrawtabcallback). The callback function can retrieve tab control and tab settings, but no modifications should be made to the tab control in any way. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## SFTTABS_DWORD_PTR Type Definition *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/typedef_sfttabs_dword_ptr* Defines a type large enough to hold a DWORD or pointer value. ``` typedef DWORD_PTR SFTTABS_DWORD_PTR; ``` ### Comments SFTTABS_DWORD_PTR defines a type large enough to hold a DWORD or pointer value. On Intel 32-bit platforms (IX86), a DWORD and pointer value have the same size (4 bytes). The SFTTABS_DWORD_PTR type was introduced to support 64-bit platforms, where a DWORD and a pointer do not have the same size. In earlier releases of SftTabs/DLL, certain fields were defined using the generic type DWORD. These have been replaced with SFTTABS_DWORD_PTR, where a pointer or DWORD value needs to be saved. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## SFTTABS_GRAPH Structure *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/struct_sfttabs_graph* Describes a tab's picture component and its location. ``` typedef struct tagSftTabsGraph { WORD location; WORD type; union tagSftTabsItem { HICON hIcon; HBITMAP hBitmap; struct tagSftTabsImage { short iImage; short iImageDisabled; } Image; struct tagSftTabsCBSending { short cx; short cy; } CBSendingImage; } item; } SFTTABS_GRAPH, * LPSFTTABS_GRAPH; ``` ### Members location Describes the location of the bitmap, relative to the tab text. The following values can be used: | | | | --- | --- | | SFTTABS_GRAPH_NONE | No bitmap or icon, text is centered horizontally and vertically. | | SFTTABS_LEFTVALIGN | No bitmap or icon, text is left aligned. Use this option for tab controls with a vertical orientation to line up the tab text on the left side. The text is centered vertically. | | SFTTABS_RIGHTVALIGN | No bitmap or icon, text is right aligned. Use this option for tab controls with a vertical orientation to line up the tab text on the right side. The text is centered vertically. | | SFTTABS_GRAPH_LEFTVALIGN | Bitmap or icon, tab picture is left aligned, followed by the tab text. Use this option for tab controls with a vertical orientation to line up the tab picture on the left side. The text and picture are centered vertically. | | SFTTABS_GRAPH_RIGHTVALIGN | Bitmap or icon, tab picture is right aligned. The tab text is located to the left of the tab picture. Use this option for tab controls with a vertical orientation to line up the tab picture on the right side. The text and picture are centered vertically. | | SFTTABS_GRAPH_TOP | Bitmap or icon, tab picture is above the tab text. The text and picture are centered horizontally. | | SFTTABS_GRAPH_BOTTOM | Bitmap or icon, tab picture is below the tab text. The text and picture are centered horizontally. | | SFTTABS_GRAPH_LEFT | Bitmap or icon, tab picture is on the left of the tab text. The text and picture are centered horizontally and vertically. | | SFTTABS_GRAPH_RIGHT | Bitmap or icon, tab picture is on the right of the tab text. The text and picture are centered horizontally and vertically. | If a rotated font is used, the orientation of the font's base line is used to determine the actual location of the bitmap or icon. type This member is provided for compatibility with versions prior to SftTabs/DLL 7.0. Instead, the [SFTTABS_TAB](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/struct_sfttabs_tab), TabPicture member should be used to define the tab picture. If the TabPicture member defines a picture, the *type* member is ignored. Describes the type of tab picture. The following values can be used: | | | | --- | --- | | 0 | No tab picture. | | SFTTABS_GRAPH_ICON | Tab picture is an icon. The *hIcon* field of the *item* union contains a valid icon handle. | | SFTTABS_GRAPH_BITMAP | Tab picture is a bitmap. The *hBitmap* field of the *item* union contains a valid bitmap handle. | | SFTTABS_GRAPH_IMAGELIST | Tab picture is defined using an ImageList control. The *iImage* and *iImageDisabled* fields of the *Image* union contain the index of the image to be used. | hIcon This member is provided for compatibility with versions prior to SftTabs/DLL 7.0. Instead, the SFTTABS_TAB, TabPicture member should be used to define the tab picture. If the TabPicture member defines a picture, the *type* member is ignored. An icon handle, used as tab picture if *type* is defined as SFTTABS_GRAPH_ICON. hBitmap This member is provided for compatibility with versions prior to SftTabs/DLL 7.0. Instead, the SFTTABS_TAB, TabPicture member should be used to define the tab picture. If the TabPicture member defines a picture, the *type* member is ignored. A bitmap handle, used as tab picture if *type* is defined as SFTTABS_GRAPH_BITMAP. The [top, left pixel](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_bitmap_transparency) of the bitmap must contain the image's [background](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_background) color. This color will be replaced by the actual window background color when the bitmap is displayed. iImage This member is provided for compatibility with versions prior to SftTabs/DLL 7.0. Instead, the SFTTABS_TAB, TabPicture member should be used to define the tab picture. If the TabPicture member defines a picture, the *type* member is ignored. The picture index used as tab picture if *type* is defined as SFTTABS_GRAPH_IMAGELIST. The picture is drawn transparently, based on the definition of the picture in the ImageList control. This *iImage* index is used only if the tab is enabled. If the tab is disabled, *iImageDisabled* is used instead. The picture index refers to the ImageList control defined using the SFTTABS_TAB structure. If *hImageList* in the SFTTABS_TAB structure is NULL, the default ImageList defined using the [SFTTABS_CONTROL](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/struct_sfttabs_control) structure is used instead. iImageDisabled This member is provided for compatibility with versions prior to SftTabs/DLL 7.0. Instead, the SFTTABS_TAB, TabPicture member should be used to define the tab picture. If the TabPicture member defines a picture, the *type* member is ignored. The picture index used as tab picture if *type* is defined as SFTTABS_GRAPH_IMAGELIST. The picture is drawn transparently, based on the definition of the picture in the ImageList control. This *iImageDisabled* index is used only if the tab is disabled. If the tab is enabled, *iImage* is used instead. The picture index refers to the ImageList control defined using the SFTTABS_TAB structure. If *hImageList* in the SFTTABS_TAB structure is NULL, the default ImageList defined using the SFTTABS_CONTROL structure is used instead. ### Comments The SFTTABS_GRAPH structure describes a tab's picture component and its location. > Applications developed using SftTabs/DLL 7.0 (or newer) should use the SFTTABS_TAB, TabPicture member to define the tab picture. Only the *location* member of this structure is used to define the location of the tab picture. There are no default tab bitmaps or icons. Bitmap and icon handles are owned by the application. The handles have to remain valid until they are no longer used by the tab control, usually until the tab control is destroyed. The application is responsible for deleting the handles when they are no longer used. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## SFTTABS_LONG_PTR Type Definition *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/typedef_sfttabs_long_ptr* Defines a type large enough to hold a long or pointer value. ``` typedef LONG_PTR SFTTABS_LONG_PTR; ``` ### Comments SFTTABS_LONG_PTR defines a type large enough to hold a long or pointer value. On Intel 32-bit platforms (IX86), a long and pointer value have the same size (4 bytes). The SFTTABS_LONG_PTR type was introduced to support 64-bit platforms, where a long and a pointer do not have the same size. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## SFTTABS_MAXROWS Preprocessor Symbol *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/def_sfttabs_maxrows* Defines the maximum number of [tab rows](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/pop_tabrows). ``` #define SFTTABS_MAXROWS 32 ``` ### Comments The SFTTABS_MAXROWS preprocessor symbol defines the maximum number of tab rows. SFTTABS_MAXROWS defines the theoretical maximum number of tab rows supported by any tab control. Some tab styles may restrict the maximum rows to a lower number. The [SftTabs/DLL Wizard](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_wizarddesign) can be used to determine the maximum value based on the tab style selected. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## SFTTABS_MAXTABS Preprocessor Symbol *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/def_sfttabs_maxtabs* Defines the maximum number of tabs per tab control. ``` #define SFTTABS_MAXTABS 256 ``` ### Comments The SFTTABS_MAXTABS preprocessor symbol defines the maximum number of tabs per tab control. SFTTABS_MAXTABS defines the theoretical maximum number of tabs supported by any tab control. Some tab styles may restrict the maximum number of tabs to a lower number. The [SftTabs/DLL Wizard](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_wizarddesign) can be used to determine the maximum value based on the tab style selected. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## SFTTABS_NOCOLOR Preprocessor Symbol *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/def_sfttabs_nocolor* Indicates that the default color should be used. ``` #define SFTTABS_NOCOLOR ((COLORREF)-1) ``` ### Comments The SFTTABS_NOCOLOR preprocessor symbol is used to indicate that the default color should be used. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## SFTTABS_STATIC Preprocessor Symbol *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/def_sfttabs_static* The SFTTABS_STATIC preprocessor symbol defines static [linking](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_buildingapp) of SftTabs/DLL to an application. ``` #define SFTTABS_STATIC ``` ### Comments The SFTTABS_STATIC preprocessor symbol defines static linking of SftTabs/DLL to an application. It affects the [Lib file](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_distributing) to be linked with the application. The SFTTABS_STATIC preprocessor symbol should be defined using project settings as shown in section "Building Applications". See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## SFTTABS_STYLETABLEA Structure *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/struct_sfttabs_styletablea* Describes each available tab style. ``` typedef struct tagSftTabsStyleTableA { /* Notice, these strings are always ANSI strings */ LPCSTR lpszDesc; /* Style description */ LPCSTR lpszStyle; /* style ID */ DWORD style; DWORD styleEx; /* extended style - new in 4.5 */ short fAvailable; /* True if available */ short res1s; /* reserved */ } SFTTABS_STYLETABLEA, * LPSFTTABS_STYLETABLEA; ``` ### Members lpszDesc The text description of the tab style. lpszStyle The text literal of the selected tab style. This can be used by a resource editor to translate the tab control style into a textual representation of the value, using the predefined symbols for tab styles. style The supported attributes of the tab style. Once a tab control is created, this style information can also be retrieved using GetWindowWord(hwnd, GWL_STYLE). styleEx The supported attributes of the tab style. | | | | --- | --- | | SFTTABSSTYLE_EX_DUAL | dual-sided control | fAvailable TRUE if the style described by the current entry is available. This field is always TRUE for all styles. ### Comments The SFTTABS_STYLETABLEA structure describes each available tab style. The SFTTABS_STYLETABLEA structure is used by the [SftTabs/DLL Wizard](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_wizarddesign) to display all available tab styles. The style table can be retrieved using the [SftTabs_GetStyleTable](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_getstyletable) function. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## SFTTABS_TAB Structure *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/struct_sfttabs_tab* Describes one tab label, including its colors, picture and text components. ``` typedef struct tagSftTabsTab { /* modifiable fields */ COLORREF colorBg, colorFg; /* color */ COLORREF colorBgSel, colorFgSel; SFTTABS_GRAPH graph; /* graphics */ BOOL fEnabled; /* enabled/disabled status */ SFTTABS_DWORD_PTR userData; /* userdata */ SFTTABS_DWORD_PTR lpTabData; /* reserved for C, C++ class implementation */ HWND hwndSubDlg; /* reserved for C, C++ class implementation */ COLORREF colorFlybyFg; /* Flyby foreground color */ COLORREF colorClientArea; /* Client area color */ // the following inserted fields have rendered 4.0 incompatible with 3.5 DWORD animationTimeShow; /* # of milliseconds for animation */ DWORD animationStyleShow; /* type of animation */ DWORD animationTimeHide; /* # of milliseconds for animation */ DWORD animationStyleHide; /* type of animation */ // the following inserted fields have rendered 4.5 incompatible with 4.0 HIMAGELIST hImageList; /* imagelist used for this tab */ BOOL fHidden; /* hide tab if True */ // the following inserted fields have rendered 5.0 incompatible with 4.5 COLORREF colorBgStart, colorBgEnd; /* gradient fill background color */ COLORREF colorBgSelStart, colorBgSelEnd;/* gradient fill background color, active tab */ COLORREF colorClientAreaStart, colorClientAreaEnd;/* gradient fill client area color */ // the following inserted fields have rendered 6.0 incompatible with 5.0 SFT_PICTURE TabPicture; // tab picture SFT_PICTURE TabPictureDisabled; // tab picture (disabled) SFT_PICTURE TabPictureHot; // tab picture (hot) // the following inserted fields have rendered 6.5 incompatible with 6.0 short fHasCloseButton; /* tab has a tab close button - uses TabPicture2.... images*/ short gap2; /* gap between tab label and second tab image */ SFT_PICTURE TabPicture2; /* tab picture 2 */ SFT_PICTURE TabPicture2Active; /* tab picture 2, active tab */ SFT_PICTURE TabPicture2Disabled; /* tab picture 2 (disabled) */ SFT_PICTURE TabPicture2Hot; /* tab picture 2 (hot) */ // end of inserted incompatible area /* read/only information */ int x, y; /* position (top left corner) */ int cx, cy; /* width and height */ int cxVis, cyVis; /* width and height of visible portion */ LPTSTR lpszText; /* label text */ LPTSTR lpszToolTip; /* tool tip text (formerly res10) */ // the following inserted fields have rendered 4.5 incompatible with 4.0 int iTab; /* tab index (visible tabs only in aTab[] */ int iRealTab; /* tab index (all tabs in aRealTab[] */ // the following inserted fields have rendered 6.0 incompatible with 5.0 RECT rectPic, rectText; /* location of the tab's tab picture and tab label */ // the following inserted fields have rendered 6.5 incompatible with 6.0 RECT rectPic2; /* location of the tab's tab picture2 */ // end of inserted incompatible area SFTTABS_DWORD_PTR res11; /* reserved */ } SFTTABS_TAB, * LPSFTTABS_TAB; typedef const SFTTABS_TAB * LPCSFTTABS_TAB; ``` ### Members colorBg The [background](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_background) color of the tab when the tab is not the [active tab](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/pop_activetab). Use a color value or [SFTTABS_NOCOLOR](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/def_sfttabs_nocolor), the default window background color. If *fTextOnly* is TRUE (see [SFTTABS_CONTROL](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/struct_sfttabs_control)), this background color is only used as background color of the tab text. The remainder of the tab will be filled with the tab control's background color. This value can be modified using [SetTabInfo](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_settabinfo). When [using themes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_using_themes), this color value is ignored. colorFg The foreground text color of the tab when the tab is not the active tab. Use a color value or SFTTABS_NOCOLOR, the default window text color. This value can be modified using SetTabInfo. When using themes, this color value is ignored. colorBgSel The background color of the tab when the tab is the active tab. Use a color value or SFTTABS_NOCOLOR, the default window background color. If *fTextOnly* is TRUE (see SFTTABS_CONTROL), this background color is only used as background color of the tab text. The remainder of the tab will be filled with the tab control's background color. This value can be modified using SetTabInfo. When using themes, this color value is ignored. colorFgSel The foreground text color of the tab when the tab is the active tab. Use a color value or SFTTABS_NOCOLOR, the default window text color. This value can be modified using SetTabInfo. When using themes, this color value is ignored. graph The picture component. See [SFTTABS_GRAPH](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/struct_sfttabs_graph) for more information. This value can be modified using SetTabInfo. fEnabled The tab status. Set to TRUE to enable the tab or FALSE to disable. A disabled tab will be shown with its picture bitmap component drawn in a "grayed" fashion. Icons are always drawn with their original colors, never grayed. The text portion will be shown grayed if the default colors (SFTTABS_NOCOLOR) are defined, otherwise the specified colors will be used. This value can be modified using SetTabInfo. When using themes, a disabled tab may not be distinguishable from an enabled tab. Tabs can also be completely hidden using the *fHidden* member. userData An application defined value associated with the tab. This value can be modified using SetTabInfo. lpTabData Stores a pointer used for the C and C++ implementation of tabbed dialogs. For C, the pointer points to a function of type [SFTTABS_TABCALLBACK](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/typedef_sfttabs_tabcallback). This callback routine is called by SftTabs/DLL to create and destroy the page associated with this tab. For C++, the pointer points to the C++ object based on [CSftTabsPage](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses). This value can be modified using SetTabInfo, [SetTabDialog](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabs_settabdialog) or [SetTabWindowPage](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabs_settabwindowpage). hwndSubDlg Stores a window handle used for the C and C++ implementation of tabbed dialogs. The window handle describes the page attached to the tab. This value can be modified using SetTabInfo. colorFlybyFg The foreground color used for [flyby highlighting](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_flyby_highlighting) (if enabled). If SFTTABS_NOCOLOR is specified, the default is RGB(0,0,128). When using themes, this color value is ignored. colorClientArea The background color used to fill the [client area](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/pop_clientarea). The client area is not visible if child windows or child dialogs use the entire client area, which is normally the case in tabbed dialogs and windows. However, tabbed dialogs will automatically use this color as background color for the tab page (see Background). The client area (or frame) of rows appearing behind the current client area use the color of the row's first tab if *fUseClientAreaColor* in the SFTTABS_CONTROL structure is set to TRUE. When using themes, this color value is ignored. animationTimeShow Defines the amount of time to be used for the transition effect when displaying the tab page attached to this tab (if any). Use one of the following values: | | | | --- | --- | | 0 | The default transition effect defined using SFTTABS_CONTROL, defaultAnimationStyleShow and defaultAnimationTimeShow is used. | | SFTTABS_ANIMATE_NONE | No transition effect. The default transition effect defined using SFTTABS_CONTROL, defaultAnimationStyleShow and defaultAnimationTimeShow is ignored. | | *milliseconds* | The amount of elapsed time to be used for the transition effect, in milliseconds. | animationStyleShow Defines the desired visual transition effect. This value is ignored if *animateTimeShow* is not a positive number defining an elapsed time. Use one of the following values: | | | | --- | --- | | SFTTABS_ROLL_FROM_LEFT | Rolls the page into view, starting at the left edge. | | SFTTABS_ROLL_FROM_RIGHT | Rolls the page into view, starting at the right edge. | | SFTTABS_ROLL_FROM_TOP | Rolls the page into view, starting at the top edge. | | SFTTABS_ROLL_FROM_BOTTOM | Rolls the page into view, starting at the bottom edge. | | SFTTABS_SLIDE_FROM_LEFT | Slides the page into view, starting at the left edge. | | SFTTABS_SLIDE_FROM_RIGHT | Slides the page into view, starting at the right edge. | | SFTTABS_SLIDE_FROM_TOP | Slides the page into view, starting at the top edge. | | SFTTABS_SLIDE_FROM_BOTTOM | Slides the page into view, starting at the bottom edge. | | SFTTABS_EXPAND_CENTER | Displays the page, expanding it from the center outwards. | animationTimeHide Reserved for future use. Must be set to 0. animationStyleHide Reserved for future use. Must be set to 0. hImageList The ImageList control used for this tab if the *graph* member of the SFTTABS_TAB structure defines a tab picture located in an ImageList control. If *hImageList* is NULL, the default ImageList control defined using the SFTTABS_CONTROL structure is used instead. fHidden The tab visibility. Set to TRUE to hide the tab or FALSE to show. A hidden tab is never displayed. Its tab page is completely hidden also and the user cannot make the tab visible. Only the application can make a hidden tab visible. This is not equivalent to a tab that is currently not visible because the tab may have scrolled off the edge of the control. This value can be modified using SetTabInfo. Hidden tabs are best used in situations where certain groups of users should not have access to all tabs of a tab control, without being aware that additional tabs may exist. Otherwise, disabling a tab is possible using the *fEnabled* member. A disabled tab is still visible to the end user. colorBgStart The background color (starting color when using a gradient fill along with *colorBgEnd*) of the tab when the tab is not the active tab. Use a color value or SFTTABS_NOCOLOR, the default window background color. If *fTextOnly* is TRUE (see SFTTABS_CONTROL), this background color is only used as background color of the tab text. The remainder of the tab will be filled with the tab control's background color. This value can be modified using SetTabInfo. When using themes, this color value is ignored. If both *colorBgStart* and *colorBgEnd* are defined, the tab is rendered using a gradient fill when the tab is not the current tab. On display devices that do not support gradient fills or if fewer than 65K colors are available, *colorBg* is used instead. colorBgEnd The background color (ending color when using a gradient fill along with *colorBgStart*) of the tab when the tab is not the active tab. Use a color value or SFTTABS_NOCOLOR, the default window background color. If *fTextOnly* is TRUE (see SFTTABS_CONTROL), this background color is only used as background color of the tab text. The remainder of the tab will be filled with the tab control's background color. This value can be modified using SetTabInfo. When using themes, this color value is ignored. If both *colorBgStart* and *colorBgEnd* are defined, the tab is rendered using a gradient fill when the tab is not the current tab. On display devices that do not support gradient fills or if fewer than 65K colors are available, *colorBg* is used instead. colorBgSelStart The background color (starting color when using a gradient fill along with *colorBgSelEnd*) of the tab when the tab is the active tab. Use a color value or SFTTABS_NOCOLOR, the default window background color. If *fTextOnly* is TRUE (see SFTTABS_CONTROL), this background color is only used as background color of the tab text. The remainder of the tab will be filled with the tab control's background color. This value can be modified using SetTabInfo. When using themes, this color value is ignored. If both *colorBgSelStart* and *colorBgSelEnd* are defined, the tab is rendered using a gradient fill when the tab is the current tab. On display devices that do not support gradient fills or if fewer than 65K colors are available, *colorBg* is used instead. colorBgSelEnd The background color (ending color when using a gradient fill along with *colorBgSelStart*) of the tab when the tab is the active tab. Use a color value or SFTTABS_NOCOLOR, the default window background color. If *fTextOnly* is TRUE (see SFTTABS_CONTROL), this background color is only used as background color of the tab text. The remainder of the tab will be filled with the tab control's background color. This value can be modified using SetTabInfo. When using themes, this color value is ignored. If both *colorBgSelStart* and *colorBgSelEnd* are defined, the tab is rendered using a gradient fill when the tab is the current tab. On display devices that do not support gradient fills or if fewer than 65K colors are available, *colorBg* is used instead. colorClientAreaStart The background color (starting color when using a gradient fill along with *colorClientAreaEnd*) used to fill the client area. The client area is not visible if child windows or child dialogs use the entire client area, which is normally the case in tabbed dialogs and windows. However, tabbed dialogs will automatically use this color as background color for the tab page (see Background). The client area (or frame) of rows appearing behind the current client area use the color of the row's first tab if *fUseClientAreaColor* in the SFTTABS_CONTROL structure is set to TRUE. When using themes, this color value is ignored. colorClientAreaEnd The background color (ending color when using a gradient fill along with *colorClientAreaStart*) used to fill the client area. The client area is not visible if child windows or child dialogs use the entire client area, which is normally the case in tabbed dialogs and windows. However, tabbed dialogs will automatically use this color as background color for the tab page (see Background). The client area (or frame) of rows appearing behind the current client area use the color of the row's first tab if *fUseClientAreaColor* in the SFTTABS_CONTROL structure is set to TRUE. When using themes, this color value is ignored. TabPicture Defines the tab picture displayed for the tab. The [SFT_PICTURE](https://softelvdm.com/Documentation/SftPicture2/Topic/struct_sft_picture) structure is used to define the exact image and image type used (a bitmap, icon or ImageList image, [GDI+](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_gdiplus) image, etc.). If the *TabPicture* member defines a picture, only the SFTTABS_GRAPH structure's *location* member is used to define the position of the graphic. The remaining members of the SFTTABS_GRAPH structure are ignored. The *TabPictureHot* and *TabPictureDisabled* members can be used to define a hot (flyby highlighting) or disabled tab (see *fEnabled*). TabPictureHot Defines the tab picture displayed for the tab when the tab is hot (flyby highlighting). This member is optional. If no tab picture is defined, the default *TabPicture* member is used instead. If the *TabPicture* member doesn't define a picture, the *TabPictureHot* and *TabPictureDisabled* members are ignored. TabPictureDisabled Defines the tab picture displayed for the tab when the tab is disabled (see *fEnabled*). This member is optional. If no tab picture is defined, the default *TabPicture* member is used instead. If the *TabPicture* member doesn't define a picture, the *TabPictureHot* and *TabPictureDisabled* members are ignored. fHasCloseButton Defines whether the second tab picture is shown for this tab. If the *fHasCloseButton* member is set to FALSE, the *TabPicture2* member is ignored and the second tab image is never shown. gap2 Defines the gap between the tab label (or the first tab image) and the second tab image (in pixels). TabPicture2 Defines the second tab picture displayed for the tab. This is typically used for a tab Close button. It is only displayed if the tab is the current tab or the mouse cursor is located on the tab. The SFT_PICTURE structure is used to define the exact image and image type used (a bitmap, icon or ImageList image, GDI+ image, etc.). If the *TabPicture2* member defines a picture, only the SFTTABS_GRAPH structure's *location* member is used to define the position of the graphic. The remaining members of the SFTTABS_GRAPH structure are ignored. If the *fHasCloseButton* member is set to FALSE, the *TabPicture2* member is ignored and the second tab image is never shown. The *TabPicture2Hot* and *TabPicture2Disabled* members can be used to define the second tab picture for a hot (flyby highlighting) or disabled tab (see *fEnabled*). If not specified, the default second tab image is used instead (see *TabPicture2*). TabPicture2Active Defines the second tab picture displayed for the tab when the tab is the current tab. If not specified, the default second tab image is used instead (see *TabPicture2*). If the *TabPicture2* member doesn't define a picture, the *TabPicture2Active* member is ignored. TabPicture2Hot Defines the second tab picture displayed for the tab when the tab is hot (flyby highlighting). This member is optional. If no second tab picture is defined, the default *TabPicture2* member is used instead. If the *TabPicture2* member doesn't define a picture, the TabPicture2Hot and *TabPicture2Disabled* members are ignored. TabPicture2Disabled Defines the second tab picture displayed for the tab when the tab is disabled (see *fEnabled*). This member is optional. If no second tab picture is defined, the default *TabPicture2* member is used instead. If the *TabPicture2* member doesn't define a picture, the *TabPicture2Hot* and *TabPicture2Disabled* members are ignored. cx, cy Current theoretical width and height of the tab. A tab may be truncated in a scrollable tab control. In this case, the *cx *and *cy *members hold the full, untruncated size of the tab. cxVis, cyVis Current actual width and height of the tab. A tab may be truncated in a scrollable tab control. In this case, the *cxVis *and *cyVis *members hold the size of the visible portion of the tab. lpszText The tab text. This value can be modified using [SetTabLabel](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_settablabel). lpszToolTip The tab's [ToolTip](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_tooltips) text. This value can be modified using [SetToolTip](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_settooltip). iTab The zero-based index of the tab. This includes visible and hidden tabs. iRealTab The zero-based index of the tab. This only includes visible tabs. Hidden tabs are not included. rectPic The location of the tab picture (if present) in pixels, relative to the top, left corner of the control. rectText The location of the tab label (if present) in pixels, relative to the top, left corner of the control. rectPic2 The location of the second tab picture (if present) in pixels, relative to the top, left corner of the control. ### Comments The SFTTABS_TAB structure describes one tab label, including its colors, picture and text components. An RGB value or a GetSysColor index value can be specified for all color values. If a color index is used, the high-order bit must be set (e.g., COLOR_WINDOW | 0x80000000L). The SFTTABS_TAB structure can be defined using the [SftTabs/DLL Wizard](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_wizarddesign). This example changes a tab's background color. C ``` SFTTABS_TAB Tab; SftTabs_GetTabInfo(hwndTab, 2, &Tab); Tab.colorBg = RGB(255, 0, 0); SftTabs_SetTabInfo(hwndTab, 2, &Tab); ``` C++ ``` SFTTABS_TAB Tab; m_Tab.GetTabInfo(2, &Tab); Tab.colorBg = RGB(255, 0, 0); m_Tab.SetTabInfo(2, &Tab); ``` See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | C++ Classes | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## SFTTABS_TABCALLBACK Type Definition *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/typedef_sfttabs_tabcallback* 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); ``` ### Parameters 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. ### Returns 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. ### Comments 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. ### Example This example supports a page which is kept when switching away from the [active tab](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/pop_activetab): 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](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## SwitchTab *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_switchtab* Switches to the next/previous tab. C ``` void SftTabs_SwitchTab(HWND hwndCtl, BOOL fNext); ``` C++ ``` void CSftTabs::SwitchTab(BOOL fNext); ``` ### Parameters hwndCtl The window handle of the tab control. fNext If TRUE is specified, the next available tab with a higher tab index is made the [active tab](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/pop_activetab), otherwise the previous tab (with a lower tab index) is made the active tab. ### Comments The SwitchTab function switches to the next/previous tab. SwitchTab will skip disabled tabs. If no next/previous tab is available, the function has no effect. The [SetCurrentTab](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_setcurrenttab) function can be used to make a tab active by using its index. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## TabSwitched *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabswindowsheet_tabswitched* Handles the [SFTTABSN_SWITCHED](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) notification. C++ ``` protected: void CSftTabsWindowSheet::TabSwitched(CWnd* pParent, CSftTabs* pTabCtl); ``` ### Parameters pParent The CWnd based object describing the tab control's parent window. pTabCtl A pointer to the tab control's [CSftTabs](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) based object. ### Comments The TabSwitched function handles the SFTTABSN_SWITCHED notification. A tabbed window must call this function to process the SFTTABSN_SWITCHED notification that is generated by the tab control to switch between pages. Message map entries must also be added to the tab control's parent window. ### Example This example implements the suggested OnTabSwitched function that calls TabSwitched to switch between pages: ``` // Add the following definitions to the tab control's parent window // class CYourSheet afx_msg void OnTabSwitching(); afx_msg void OnTabSwitched(); // Add the following to the parent window's message map ON_SFTTABSN_SWITCHING(IDC_TAB, OnTabSwitching) ON_SFTTABSN_SWITCHED(IDC_TAB, OnTabSwitched) // Implement the following functions in CYourSheet void CYourSheet::OnTabSwitching() { TabSwitching(this, &m_Tab); } void CYourSheet::OnTabSwitched() { TabSwitched(this, &m_Tab); } ``` See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | C++ Classes | Notifications ## TabSwitching *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabswindowsheet_tabswitching* Handles the [SFTTABSN_SWITCHING](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) notification. C++ ``` protected: void CSftTabsWindowSheet::TabSwitching(CWnd* pParent, CSftTabs* pTabCtl); ``` ### Parameters pParent The CWnd based object describing the parent window. pTabCtl A pointer to the tab control's [CSftTabs](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) based object. ### Comments The TabSwitching function handles the SFTTABSN_SWITCHING notification. A tabbed window must call this function to process the SFTTABSN_SWITCHING notification that is generated by the tab control to switch between pages. TabSwitching calls the [CSftTabsWindowPage::AllowSwitch](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabswindowpage_allowswitch) function of the current page to determine if the next page can be activated. [GetNextTab](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_getnexttab) returns the index of the next tab about to become active. By sending a WM_CANCELMODE message, an application can prevent the tab control from activating the next page. Message map entries must also be added to the tab control's parent window. ### Example This example implements the suggested OnTabSwitching function that calls TabSwitching to switch between pages: ``` // Add the following definitions to the tab control's parent window // class CYourSheet afx_msg void OnTabSwitching(); afx_msg void OnTabSwitched(); // Add the following to the parent window's message map ON_SFTTABSN_SWITCHING(IDC_TAB, OnTabSwitching) ON_SFTTABSN_SWITCHED(IDC_TAB, OnTabSwitched) // Implement the following functions in CYourSheet void CYourSheet::OnTabSwitching() { TabSwitching(this, &m_Tab); } void CYourSheet::OnTabSwitched() { TabSwitched(this, &m_Tab); } ``` See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | C++ Classes | Notifications ## TerminateTabControl *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabswindowsheet_terminatetabcontrol* Terminates a tab control and deactivates all pages. C++ ``` protected: void CSftTabsWindowSheet::TerminateTabControl(CWnd* pWnd, CSftTabs* pTabCtl); ``` ### Parameters pWnd The CWnd based object describing the tab control's parent window. pTabCtl A pointer to the tab control's [CSftTabs](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) based object. ### Comments The TerminateTabControl function terminates a tab control and deactivates all pages. A tabbed window's tab control has to be terminated, which deactivates and destroys all pages attached to the tab control. This is typically done in the OnDestroy member function of the tabbed window. When a tabbed window is destroyed, all attached CSftTabsWindowPage objects are automatically destroyed. However, any dynamically allocated CSftTabsWindowPage derived objects must be deleted (using the C++ delete operator) by the application. ### Example This example terminates the tab control of a tabbed window: ``` void CSampleView::OnDestroy() { // Remove all pages from the tab control TerminateTabControl(this, &m_Tab); // Unregister, or the window properties used won't be removed SftTabs_UnregisterWindow(m_hWnd); CView::OnDestroy(); } ``` See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | C++ Classes | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## TransparentControls *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_transparentcontrols* 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](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_background) handling. An application can define a background color for a tab page using the [SFTTABS_TAB](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/struct_sfttabs_tab), * colorClientArea* member (see [SetTabInfo](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_settabinfo)) or define a background bitmap using the [SFTTABS_CONTROL](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/struct_sfttabs_control), hInsideBitmap member (see [SetControlInfo](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_setcontrolinfo)). *lpfnDrawBackground* overrides other background definitions and allows an application to render the background. lpmessage, lpwParam, lplParam 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](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_using_themes) are active. | | [SFTTABS_DRAWBG_OVERRIDETHEME](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabspage_m_flagdrawbackground) | *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](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_transitioneffects). When [using C](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/g_usingc), the SftTabs_TransparentControls function handles background painting. It is not used for C++ and MFC. [CSftTabsPage::m_lpfnDrawBackground](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_csfttabspage_m_lpfndrawbackground) can be used to define special background handling. > Backgrounds require Common Controls version 6. 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. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## UnregisterApp *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_unregisterapp* Unregisters the application. C ``` void WINAPI SftTabs_UnregisterApp(HINSTANCE hInst); ``` C++ ``` static void CSftTabs::UnregisterApp(); ``` ### Parameters hInst The instance handle of the application. ### Comments The UnregisterApp function unregisters the application. This call allows SftTabs/DLL to unregister all window classes used and perform cleanup processing. This call has to be made after all SftTabs/DLL controls have been destroyed. The call to this function should be made during application termination. ### Example This example unregisters an application from SftTabs/DLL: C ``` int PASCAL WinMain(HINSTANCE hinst, HINSTANCE hinstPrev, LPSTR Cmd, int cmdShow) { SftTabs_RegisterApp(hinst); // Register application .... application message loop SftTabs_UnregisterApp(hinst); // Unregister application return msg.wParam; } ``` C++ ``` int CSampleApp::ExitInstance() // based on CWinApp { // Unregister from SftTabs/DLL CSftTabs::UnregisterApp(); // call base class return CWinApp::ExitInstance(); } ``` See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications) ## UnregisterDialog *Source: https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_unregisterdialog* Unregisters a dialog or window which has been previously registered using [SftTabs_RegisterDialog](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/function_registerdialog) or SftTabs_RegisterWindow. C ``` BOOL WINAPI SftTabs_UnregisterDialog(HWND hwndDialog); BOOL WINAPI SftTabs_UnregisterWindow(HWND hwndWnd); ``` ### Parameters hwndDialog, hwndWnd The window handle of the window or dialog to be unregistered. ### Returns The return value is TRUE if the window is successfully unregistered with SftTabs/DLL. ### Comments The UnregisterDialog function unregisters a dialog or window which has been previously registered using SftTabs_RegisterDialog or SftTabs_RegisterWindow. If this function is not called, resource leaks may be experienced. This C example shows a typical tabbed dialog WM_DESTROY message handler: ``` case WM_DESTROY: { // Unregister, or the window properties used won't be removed SftTabs_UnregisterDialog(hwndDlg); // destroy all pages SftTabs_Destroy(hwndDlg, GetDlgItem(hwndDlg, IDC_TAB)); break; } ``` See Also [C/C++ API](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_api) | [C++ Classes](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_cppclasses) | [Notifications](https://softelvdm.com/Documentation/SftTabs%20DLL%207%200/Topic/i_notifications)