16-Bit Applications

For the most part, retrieving version and platform information for 16-bit applications relies almost completely on the GetVersion function. The sole possible exception is a 16-bit application running under Windows 95, which can still use GetVersionEx; like the registry API, it is an undocumented function exported by KRNL386.EXE.[3] This makes determining the platform or operating system on which an application is running somewhat more complicated, since 16-bit applications can run not only on 16-bit operating systems (Windows 3.x and Windows for Workgroups), but on 32-bit ones as well.

Once again, GetVersion returns a DWORD value in which the low-order byte of the low-order word contains the major version of the operating system, while the high-order byte of the low-order word contains the operating system’s minor version. So you can retrieve the major and minor version as follows:

dwVersion = GetVersion( ) ;
dwMajorVersion = LOBYTE(LOWORD(dwVersion)) ;
dwMinorVersion = HIBYTE(LOWORD(dwVersion)) ;

Relying on the GetVersion function to identify a platform means that you have to be able to determine the platform on which your application is running based on its version number. Table D-4 lists the current and past versions of Microsoft’s major graphical operating systems, environments, and operating system extensions.

Table D-4. Major and Minor Versions Returned by GetVersion

Operating System

Type

Versions

Windows

16-bit

3.0, 3.10[a]

Windows for Workgroups ...

Get CDO & MAPI Programming with Visual Basic: now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.