|
Overview |
|
|
|
Group |
|
|
|
Quick Info
Windows NT
| Yes
| Win95
| Yes
| Win32s
| Yes
| Import Library
| kernel32.lib
| Header File
| winbase.h
| Unicode
| No
| Platform Notes
| None
|
|
|
GetVersion
The GetVersion function returns the current version number of Windows and information about
the operating system platform.
This function has been superseded by GetVersionEx, which is the preferred method for obtaining system version number
information. New applications should use GetVersionEx. The GetVersionEx function was developed because many existing Windows applications err when
examining the DWORD return value of a GetVersion function call, transposing the major and minor version numbers packed into
that DWORD. The GetVersionEx function forces applications to explicitly examine each element of version
information, and allows for future enhancements to that information.
DWORD GetVersion(VOID)
Parameters
This function has no parameters.
Return Values
If the function succeeds, the return value is a DWORD value that contains the major and minor version numbers of Windows in the low
order word, and information about the operating system platform in the high
order word.
For all platforms, the low order word contains the version number of Windows.
The low-order byte of this word specifies the major version number, in
hexadecimal notation. The high-order byte specifies the minor version (revision)
number, in hexadecimal notation.
To distinguish between operating system platforms, use the high order bit and
the low order byte, as shown in the following table:
Platform
| High order bit
| Low order byte (major version number)
| Windows NT
| zero
| 3 or 4
| Windows 95
| -
| 4
| Win32s with Windows 3.1
| -
| 3
|
For Windows NT and Win32s, the remaining bits in the high order word specify
the build number.
For Windows 95 the remaining bits of the high order word are reserved.
Remarks
This function does not return the current version number of MS-DOS.
The following code fragment illustrates how to extract information from the GetVersion return value:
dwVersion = GetVersion();
// Get major and minor version numbers of Windows
dwWindowsMajorVersion = (DWORD)(LOBYTE(LOWORD(dwVersion)));
dwWindowsMinorVersion = (DWORD)(HIBYTE(LOWORD(dwVersion)));
// Get build numbers for Windows NT or Win32s
if (dwVersion < 0x80000000) // Windows NT
dwBuild = (DWORD)(HIWORD(dwVersion));
else if (dwWindowsMajorVersion < 4) // Win32s
dwBuild = (DWORD)(HIWORD(dwVersion) & ~0x8000);
else // Windows 95 -- No build numbers provided
dwBuild = 0;
See Also
GetVersionEx
| Last news from Greatis Software |
 |
|
Nostalgia .Net |
|
.Net is powerful, but not all-powerful, so sometimes we need to use Win32 API for our .Net applications. It's simple enough with Platform Invoke if you have Win32 skill, but we do not always have time to dig the ancient documentation, declare the special types that are compatible with Win32, find the values of the Win32's constants and so on. Nostalgia .Net offers several simple-to-use classes, and components that will allow you to forget about the headache of Win32 and just use the power of Win32 in your application the same way as you use the native. Net classes. More » |
| Recommended software for developers |
 |
|
Ultimate Pack |
|
Component pack for Delphi and C++ Builder that contains runtime form designer, runtime object inspector, print suite and much more for the very special price. More » |
 |
|
Form Designer .Net |
|
Unique runtime form design solution that allows to edit any form in .Net WinForms application at runtime with full source codes for only 300 euro! More » |
 |
|
Print Suite .Net |
|
Print Suite .Net is a set of components for easy printing texts, images and grids from your WinForms applications. Full C# source codes are available More » |
 |
|
Gradient Controls .Net |
|
Gradient Controls .Net offers controls with gradient background feature. Labels, panels and so on... Full C# source codes are available More » |
 |
|
Greatis iGrid |
|
iGrid plots drawing grid right over your desktop, so you can use it everywhere, with any drawing application without any special plugins for different graphic editors. More » |
All the contacts and projectsDmitry Vasiliev (just.dmitry)
Related LinksSoftware for Visual Studio .NET developers Software for Delphi and C++ Builder developers Software for Visual Basic 6 developers Delphi Tips&Tricks MegaDetailed.NET More Online Helps Win32 Programmer's Reference Win32 Multimedia Programmer's Reference OLE Programmer's Reference Microsoft Windows Pen API Programmer's Reference Microsoft Windows Sockets 2 Reference Microsoft Windows Telephony API (TAPI) Programmer's Reference Unix Manual Pages
|