diff options
author | stanton <stanton@noemail.net> | 1999-04-16 01:51:06 (GMT) |
---|---|---|
committer | stanton <stanton@noemail.net> | 1999-04-16 01:51:06 (GMT) |
commit | 58364783d6f176ecb8520dade8d1cb1a346c0950 (patch) | |
tree | 31378e81bd58f8c726fc552d6b30cbf3ca07497b /win/tkWin32Dll.c | |
parent | 878ed3a2c9af6e583516ac48fd69ce3b349ac5f8 (diff) | |
download | tk-58364783d6f176ecb8520dade8d1cb1a346c0950.zip tk-58364783d6f176ecb8520dade8d1cb1a346c0950.tar.gz tk-58364783d6f176ecb8520dade8d1cb1a346c0950.tar.bz2 |
* Merged 8.1 branch into the main trunk
FossilOrigin-Name: 1120dc4257448ed1955333e682de48e2940cc741
Diffstat (limited to 'win/tkWin32Dll.c')
-rw-r--r-- | win/tkWin32Dll.c | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/win/tkWin32Dll.c b/win/tkWin32Dll.c index bfbdad2..7b43d99 100644 --- a/win/tkWin32Dll.c +++ b/win/tkWin32Dll.c @@ -8,12 +8,13 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWin32Dll.c,v 1.2 1998/09/14 18:23:59 stanton Exp $ + * RCS: @(#) $Id: tkWin32Dll.c,v 1.3 1999/04/16 01:51:48 stanton Exp $ */ -#include "tkPort.h" #include "tkWinInt.h" +static int tkPlatformId; + /* * The following declaration is for the VC++ DLL entry point. */ @@ -70,6 +71,8 @@ DllMain(hInstance, reason, reserved) DWORD reason; LPVOID reserved; { + OSVERSIONINFO os; + /* * If we are attaching to the DLL from a new process, tell Tk about * the hInstance to use. If we are detaching then clean up any @@ -77,9 +80,40 @@ DllMain(hInstance, reason, reserved) */ if (reason == DLL_PROCESS_ATTACH) { + os.dwOSVersionInfoSize = sizeof(os); + GetVersionEx(&os); + tkPlatformId = os.dwPlatformId; + TkWinXInit(hInstance); } else if (reason == DLL_PROCESS_DETACH) { TkWinXCleanup(hInstance); } return(TRUE); } + +/* + *---------------------------------------------------------------------- + * + * TkWinGetPlatformId -- + * + * Determines whether running under NT, 95, or Win32s, to allow + * runtime conditional code. + * + * Results: + * The return value is one of: + * VER_PLATFORM_WIN32s Win32s on Windows 3.1. + * VER_PLATFORM_WIN32_WINDOWS Win32 on Windows 95. + * VER_PLATFORM_WIN32_NT Win32 on Windows NT + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +int +TkWinGetPlatformId() +{ + return tkPlatformId; +} + |