this should be my final report, at least until another OS beyond 7 comes out.
http://support.microsoft.com/kb/92936/
in windows 3.1 things switched to the function GetVersion() which returned a DWORD:
the high byte was the major version, and the low byte was the minor version number.
but I think after Win32s GetVersionEx() was introduced, which can take two different types of structures,
depending on whether or not you need the Service Pack major+minor version number or not.
major and minor version numbers for 2000-7/2008/2008 R2
http://msdn.microsoft.com/en-us/libr...8VS.85%29.aspx
major and minor version numbers and build numbers for 95-ME
http://support.microsoft.com/kb/158238
information about win32
http://support.microsoft.com/kb/189249
information about win32s being platformid==0
http://support.microsoft.com/kb/210200
information about windows nt 3.51:
http://msdn.microsoft.com/en-us/libr...8VS.60%29.aspx http://support.microsoft.com/kb/158238 lists the OS's for Windows ME through Windows 95.
it comes from the key
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Curr entVersion[VersionNumber]
and you don't bother with the appended A's and B's because that is in a different entry.
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion[CurrentVersion]
seems to contain the version number for windows NT-family OS's, such as NT, XP, 2000, Vista, 2008 and 7 I think.
dwPlatformID.dwMajorVersion.dwMinorVersion.dwBuild Number
0.3?.1? Win32s on windows 3.1? (someone please get the info and email me back. today's win32 code is unuseable on Win32s!)
0.3?.11? Win32s on windows 3.11? (someone please get the info and email me back. today's win32 code is unuseable on Win32s!)
1.4.0.950 95
1.4.0.950 95 (SP1)
1.4.0.1111 95 OEM SR2
1.4.3.1212 95 OEM SR2.1
1.4.3.1213 95 OEM SR2.1
1.4.3.1214 95 OEM SR2.5
1.4.10.1998 98
1.4.10.2222 98 SE
1.4.90.3000 ME
2.3.1 NT 3.1 Workstation ([should be] OSVERSIONINFOEX.wProductType == VER_NT_WORKSTATION)
2.3.1 NT 3.1 Server ([should be] OSVERSIONINFOEX.wProductType != VER_NT_WORKSTATION)
2.3.51 NT 3.51 Workstation ([should be] OSVERSIONINFOEX.wProductType == VER_NT_WORKSTATION)
2.3.51 NT 3.51 Server ([should be] OSVERSIONINFOEX.wProductType != VER_NT_WORKSTATION)
2.4.0 NT 4.0 WorkStation ([should be] OSVERSIONINFOEX.wProductType == VER_NT_WORKSTATION)
2.4.0 NT 4.0 Server ([should be] OSVERSIONINFOEX.wProductType != VER_NT_WORKSTATION)
2.5.0 2000 Pro ([should be] OSVERSIONINFOEX.wProductType == VER_NT_WORKSTATION)
2.5.0 2000 Pro Advanced Server ([should be] OSVERSIONINFOEX.wProductType != VER_NT_WORKSTATION)
2.5.1.2600 XP (GetSystemMetrics(SM_MEDIACENTER) != 0 for Media Center, wSuiteMask&VER_SUITE_PERSONAL != 0 for Home otherwise Pro)
2.5.2 Server 2003 R2 (GetSystemMetrics(SM_SERVERR2) != 0) - Note: you can probably also check && OSVERSIONINFOEX.wProductType != VER_NT_WORKSTATION
2.5.2 Server 2003 (GetSystemMetrics(SM_SERVERR2) == 0) - Note: you can probably also check && OSVERSIONINFOEX.wProductType != VER_NT_WORKSTATION
2.6.0 Server 2008 (OSVERSIONINFOEX.wProductType != VER_NT_WORKSTATION)
2.6.0 Vista (OSVERSIONINFOEX.wProductType == VER_NT_WORKSTATION)
2.6.1 7 (OSVERSIONINFOEX.wProductType == VER_NT_WORKSTATION)
2.6.1 Server 2008 R2 (OSVERSIONINFOEX.wProductType != VER_NT_WORKSTATION) - Note: you can probably also check GetSystemMetrics(SM_SERVERR2) != 0
But Win32s (windows 3.1 with Win32s) has some issues with today's 32-bit executeables, so installers beware.
The last version of Visual C++ that could generate Win32s code was 4.1.
http://www.vim.org/htmldoc/os_win32.html http://msdn.microsoft.com/en-us/libr...8VS.71%29.aspx
Win32 console-mode programs are unusable on Win32s.
My attempts at a Win32 console mode program that called GetVersionEx() and GetSystemMetrics() failed on Win32s.
It appears console mode support is available on win9x/ME.
It will be difficult to find Windows 3.x apps these days, much less a compiler (VC++ 4.1 or lower) for it.