please dont rip this site Prev Next

GetVersion info  Overview  Group

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)


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:


High order bit

Low order byte (major version number)

Windows NT


3 or 4

Windows 95



  Win32s with Windows 3.1



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.


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


file: /Techref/os/win/api/win32/func/src/f42_7.htm, 4KB, , updated: 2000/4/7 12:19, local time: 2022/5/26 13:13,

 ©2022 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?
Please DO link to this page! Digg it! / MAKE!

<A HREF=""> GetVersion</A>

After you find an appropriate page, you are invited to your to this massmind site! (posts will be visible only to you before review) Just type a nice message (short messages are blocked as spam) in the box and press the Post button. (HTML welcomed, but not the <A tag: Instead, use the link box to link to another page. A tutorial is available Members can login to post directly, become page editors, and be credited for their posts.

Link? Put it here: 
if you want a response, please enter your email address: 
Attn spammers: All posts are reviewed before being made visible to anyone other than the poster.
Did you find what you needed?

  PICList 2022 contributors:
o List host: MIT, Site host, Top posters @20220526
* Page Editors: James Newton, David Cary, and YOU!
* Roman Black of Black Robotics donates from sales of Linistep stepper controller kits.
* Ashley Roll of Digital Nemesis donates from sales of RCL-1 RS232 to TTL converters.
* Monthly Subscribers: Gregg Rew. on-going support is MOST appreciated!
* Contributors: Richard Seriani, Sr.

Welcome to!