O'Reilly logo

CDO & MAPI Programming with Visual Basic: by Dave Grundgeiger

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required