DtWinVer
Features |
History |
API Reference |
Notes |
Contacting the Author |
Enclosed is a routine which provides a comprehensive method to determine which OS the program that calls it is running on. All methods it uses are fully documented on various articles on the MSDN CD. The routine provides the emulated OS aswell as the underlying OS. e.g to a Dos program Windows 95 looks like MS-DOS 7.0. A full list of the OSs it can detect are:
Some of the possible scenarios it can report on are:
8 May 1997:
13 September 1998
GetOSVersion
IsUnderlyingWindows95
IsUnderlyingWindows98
BOOL GetOSVersion(LPOS_VERSION_INFO lpVersionInformation)
Parameters
lpVersionInformation A pointer to a structure of the following form:
This will be filled in upon a successful return from the function.
Return Value
TRUE if the function was successful otherwise FALSE.
BOOL IsUnderlyingWindows95(LPOS_VERSION_INFO lpVersionInformation);
Remarks
TRUE if the structure sent in represents Windows 95 otherwise FALSE. See the code in test.cpp for its usage.
BOOL IsUnderlyingWindows98(LPOS_VERSION_INFO lpVersionInformation);
Remarks
TRUE if the structure sent in represents Windows 98 otherwise FALSE. See the code in test.cpp for its usage.
The code uses some C++isms and uses MFC header files. If you want, it would be a very simple matter of commenting a few lines here and there to get it to work on any standard "C" compiler on any PC OS. 3 mak files are also included which builds a simple application which reports the OS version, through a message box on Windows and stdio in Dos.
The mak files are:
Areas where the code may prove useful are:
PJ Naughter
Email: pjn@indigo.ie
Web: http://indigo.ie/~pjn
13th September 1998