diff options
| author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2025-09-12 14:14:26 (GMT) |
|---|---|---|
| committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2025-09-12 14:14:26 (GMT) |
| commit | 87a60afbc2b6575f5d95996436bdaca5d138fdaf (patch) | |
| tree | 7c260cd92b99ab7bf6d3265c42e9c2fdbec2bc3e /win/tkWinX.c | |
| parent | bc0bf14e28a221b797b6cae526d33efa8a3df9be (diff) | |
| parent | dd655f079219fe95caa1051af4c6ec6e0c9507ef (diff) | |
| download | tk-core-no-xp-theme.zip tk-core-no-xp-theme.tar.gz tk-core-no-xp-theme.tar.bz2 | |
Eliminate classic and XP theme on Windowscore-no-xp-theme
Diffstat (limited to 'win/tkWinX.c')
| -rw-r--r-- | win/tkWinX.c | 54 |
1 files changed, 6 insertions, 48 deletions
diff --git a/win/tkWinX.c b/win/tkWinX.c index aec0b14..5f661c0 100644 --- a/win/tkWinX.c +++ b/win/tkWinX.c @@ -87,7 +87,6 @@ static const char winScreenName[] = ":0"; /* Default name of windows display. */ static HINSTANCE tkInstance = NULL; /* Application instance handle. */ static int childClassInitialized; /* Registered child class? */ static WNDCLASSW childClass; /* Window class for child windows. */ -static int tkWinTheme = 0; /* See TkWinGetPlatformTheme */ static Tcl_Encoding keyInputEncoding = NULL; /* The current character encoding for * keyboard input */ @@ -339,60 +338,19 @@ TkWinXCleanup( * Return the Windows drawing style we should be using. * * Results: - * The return value is one of: - * TK_THEME_WIN_CLASSIC 95/98/NT or XP in classic mode - * TK_THEME_WIN_XP XP not in classic mode - * TK_THEME_WIN_VISTA Vista or higher + * The return value is: + * 3 Vista or higher * *---------------------------------------------------------------------- */ - +#ifndef TK_NO_DEPRECATED +#undef TkWinGetPlatformTheme int TkWinGetPlatformTheme(void) { - if (tkWinTheme == 0) { - OSVERSIONINFOW os; - - os.dwOSVersionInfoSize = sizeof(OSVERSIONINFOW); - GetVersionExW(&os); - - if (os.dwPlatformId != VER_PLATFORM_WIN32_NT) { - Tcl_Panic("Windows NT is the only supported platform"); - } - - /* - * Set tkWinTheme to be TK_THEME_WIN_(CLASSIC|XP|VISTA). The - * TK_THEME_WIN_CLASSIC could be set even when running under XP if the - * windows classic theme was selected. - */ - if (os.dwMajorVersion == 5 && os.dwMinorVersion >= 1) { - HKEY hKey; - LPCWSTR szSubKey = L"Control Panel\\Appearance"; - LPCWSTR szCurrent = L"Current"; - DWORD dwSize = 200; - WCHAR pBuffer[200]; - - memset(pBuffer, 0, dwSize); - if (RegOpenKeyExW(HKEY_CURRENT_USER, szSubKey, 0L, - KEY_READ, &hKey) != ERROR_SUCCESS) { - tkWinTheme = TK_THEME_WIN_XP; - } else { - RegQueryValueExW(hKey, szCurrent, NULL, NULL, (LPBYTE) pBuffer, &dwSize); - RegCloseKey(hKey); - if (wcscmp(pBuffer, L"Windows Standard") == 0) { - tkWinTheme = TK_THEME_WIN_CLASSIC; - } else { - tkWinTheme = TK_THEME_WIN_XP; - } - } - } else if (os.dwMajorVersion > 5) { - tkWinTheme = TK_THEME_WIN_VISTA; - } else { - tkWinTheme = TK_THEME_WIN_CLASSIC; - } - } - return tkWinTheme; + return 3; /* TK_THEME_WIN_VISTA */ } +#endif /* TK_NO_DEPRECATED */ /* *---------------------------------------------------------------------- |
