diff options
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 */ /* *---------------------------------------------------------------------- |
