Silverfrost Logo About Us | Contact Us
 

GET_OS_VER@

Platform

Win32(ClearWin+)

Purpose

To get version information for the operating system.

Syntax

SUBROUTINE GET_OS_VER@( PLATFORMID, MAJOR, MINOR )
INTEGER PLATFORMID, MAJOR, MINOR

Description

This routine returns values for the platform id and major and minor version numbers according to the following table.

OS

Major

Minor

Platform ID

Windows 3.1

 

 

0

Windows 95

4

0

1

Windows 98

4

10

1

Windows Me

4

90

1

Windows NT 3.51

3

51

2

Windows NT 4.0

4

0

2

Windows 2000

5

0

2

Windows XP

5

1

2

Windows Vista

6

0

2

Windows 7

6

1

2

Windows 8

6

2

2

Windows 8.1*

6

3

2

Windows 10*

10

0

2

Notes

If the executable is running in "compatibility mode" then this routine provides information about the compatible operating system rather than the machine operating system. To get information about the machine operating system use GET_WOW_VER@.

* Windows 8.1 and Windows .10 give the same results as Windows 8 unless a "target" manifest is provided (see below).

 

Targeting your application for Windows

An application can be targeted for a particular operating system by including a manifest file in a resource script. A line in the resource script takes the form:

   1 24 my.manifest 

where the file my.manifest could contain:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3"> 
  <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1"> 
    <application> 
      <!-- Windows 10 --> 
      <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/> 
      <!-- Windows 8.1 --> 
      <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/> 
      <!-- Windows Vista --> 
      <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/> 
      <!-- Windows 7 --> 
      <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/> 
      <!-- Windows 8 --> 
      <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/> 
    </application> 
  </compatibility> 
</assembly>

 Here is a sample program:

   USE clrwin 
  INTEGER maj, min, b 
  CHARACTER*80 ch 
  CALL get_os_ver@(b,maj,min) 
  PRINT*,maj,min,b 
  CALL get_wow_ver@(ch,maj,min) 
  PRINT*,maj,min 
  PRINT*,ch 
  END 
  RESOURCES
    1 24 my.manifest

 

 

Copyright © 1999-2017 Silverfrost Limited