Defines whether a control uses the current Windows theme.
C
BOOL WINAPI SftDate_GetUseThemes(HWND hwndCtl); void WINAPI SftDate_SetUseThemes(HWND hwndCtl, BOOL fUseThemes);
C++
BOOL CSftDate::GetUseThemes() const; BOOL CSftCalendar::GetUseThemes() const; void CSftDate::SetUseThemes(BOOL fUseThemes); void CSftCalendar::SetUseThemes(BOOL fUseThemes);
hwndCtl
The window handle of the date field control (SftDate) or the month calendar control (SftCalendar).
fUseThemes
TRUE to use the current theme, FALSE to draw without themes.
GetUseThemes returns TRUE if themes are used, otherwise FALSE.
The GetUseThemes and SetUseThemes functions define and retrieve whether a control uses the current Windows theme (visual styles). The default is TRUE.
With themes, a date field control draws its check box, buttons and border (SFTDATE_BORDER_FIXED3D) using the theme, and a calendar (a month calendar control or the dropdown calendar of a date field control) draws the selected day, the day under the mouse and today's marker using the theme of the Windows month calendar control. A calendar uses the theme only in light mode and only as long as the application doesn't define the colors SFTDATE_COLOR_BACK, SFTDATE_COLOR_SELECTEDBACK, SFTDATE_COLOR_HOTBACK and SFTDATE_COLOR_TODAY (SetColor).
Without themes, the parts are drawn in the classic style. Themes are not used in high contrast mode (SetHighContrastMode).
SftDate_SetAutoAdvance(c[i], fChecked);
break;
case IDC_COLORS:
for (i = 0; i < CONTROLS; ++i)
SetColorScheme(c[i], fChecked);
break;
case IDC_THEMES:
for (i = 0; i < CONTROLS; ++i)
SftDate_SetUseThemes(c[i], fChecked);
break;
}
Layout(hwndDlg);
}
/**********************************************************************/
/* Initialization */
m_Fields[i].SetAutoAdvance(fChecked);
break;
case IDC_COLORS:
for (int i = 0; i < CONTROLS; ++i)
SetColorScheme(Control(i), fChecked);
break;
case IDC_THEMES:
for (int i = 0; i < CONTROLS; ++i)
Control(i).SetUseThemes(fChecked);
break;
}
Layout();
}
void CMainDlg::OnDarkModeChanged(UINT id, NMHDR* pNMHDR, LRESULT* pResult)
{See Also C/C++ API | Categories | Notifications