SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftMask/OCX 7.0 - Masked Edit Control
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftPrintPreview/DLL 2.0 - Print Preview Control (discontinued)
SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftDirectory 3.5 - File/Folder Control (discontinued)
SftMask/OCX 7.0 - Masked Edit Control
SftOptions 1.0 - Registry/INI Control (discontinued)
SftPrintPreview/OCX 1.0 - Print Preview Control (discontinued)
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftTabs/NET 6.0 - Tab Control (discontinued)
SftTree/NET 2.0 - Tree Control
Defines whether the tree control is rendered using a dark color palette.
C
void WINAPI SftTree_SetDarkMode(HWND hwndCtl, int mode); int WINAPI SftTree_GetDarkMode(HWND hwndCtl); BOOL WINAPI SftTree_IsDarkModeActive(HWND hwndCtl); void WINAPI SftTreeSplit_SetDarkMode(HWND hwndCtl, int mode); int WINAPI SftTreeSplit_GetDarkMode(HWND hwndCtl); BOOL WINAPI SftTreeSplit_IsDarkModeActive(HWND hwndCtl);
C++
void CSftTree::SetDarkMode(int mode); int CSftTree::GetDarkMode() const; BOOL CSftTree::IsDarkModeActive() const; void CSftTreeSplit::SetDarkMode(int mode); int CSftTreeSplit::GetDarkMode() const; BOOL CSftTreeSplit::IsDarkModeActive() const;
hwndCtl
The window handle of the tree control.
mode
Defines the dark mode setting. mode can be one of the following values:
| SFTTREE_DARKMODE_OFF | The tree control is always rendered using the light color palette. This is the default. |
| SFTTREE_DARKMODE_ON | The tree control is always rendered using the dark color palette, regardless of the Windows system setting. |
| SFTTREE_DARKMODE_AUTO | The tree control follows the current Windows "Choose your mode" setting (Light / Dark) and switches automatically when the user changes the system setting. |
GetDarkMode returns a value indicating the current dark mode setting (SFTTREE_DARKMODE_OFF, SFTTREE_DARKMODE_ON or SFTTREE_DARKMODE_AUTO).
IsDarkModeActive returns TRUE if the tree control is currently rendering with the dark color palette, otherwise FALSE. When mode is SFTTREE_DARKMODE_AUTO, the return value reflects the current Windows system setting.
The SetDarkMode, GetDarkMode and IsDarkModeActive functions define and retrieve a tree control's dark mode setting.
Dark mode changes the palette used for the tree control's background, text, grid lines, selection highlight, header, footer, row headers and splitter bar. Header, footer, row-header and splitter-bar rendering use a dark-aware GDI code path; Windows themes are suppressed while dark mode is active.
When mode is SFTTREE_DARKMODE_AUTO, the tree control tracks WM_SETTINGCHANGE notifications from Windows and re-renders automatically when the user toggles the system Light / Dark setting. A SFTTREEN_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 remain in effect in dark mode unless high contrast mode is also active. Owner-draw callbacks receive the current dark state in SFTTREE_OWNERDRAW's fDarkMode field; owner-draw code is responsible for its own dark-mode compliance.
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 | Categories | Notifications
