GUI ScreenIO for Windows

 ScreenIO.com


GetVersionEx

This API returns the installed version of Windows.

Client/Server issues

If running in client/server mode, this API will return the version of Windows installed on the client machine.

To obtain the version of Windows installed on the server:

     SET WIN32API-EXECUTE-API-ON-SERVER TO TRUE

Files

Files available to copy to your system:

Usage

     COPY WIN32API.
     COPY GVERSION.

* ------------------------: Call the API.

     SET API-GETVERSIONEX TO TRUE.

     CALL 'GSWINAPI' USING WIN32API-PARMS
                           GETVERSIONEX
                           WIN32API-B
                           WIN32API-C
                           WIN32API-D
                           WIN32API-E
                           WIN32API-F.

The data returned by this API varies depending upon the operating system. To determine the precise version use this code:

     EVALUATE TRUE

       WHEN PLATFORM-WINNT
         EVALUATE GETVERSION-MAJORVERSION
           WHEN 3
             MOVE 'Windows NT 3.x' TO myversion-text
           WHEN 4
             MOVE 'Windows NT 4.x' TO myversion-text
           WHEN 5
             MOVE 'Windows 2000' TO myversion-text
           WHEN OTHER
             MOVE 'Unknown Windows NT version' TO myversion-text
           END-EVALUATE

       WHEN PLATFORM-WIN9X
         EVALUATE GETVERSION-MINORVERSION
           WHEN 0
             MOVE 'Windows 95' TO myversion-text
           WHEN OTHER
             IF WIN9X-VERSION-WINME
               MOVE 'Windows Me' TO myversion-text
             ELSE
               MOVE 'Unknown Windows 9x' TO myversion-text
             END-IF
           END-EVALUATE

       WHEN OTHER
         MOVE 'Unknown Windows version' TO myversion-text

     END-EVALUATE

Parameters specific to this function

GETVERSION-LENGTH

Size of GETVERSIONEX, in bytes.

GETVERSION-MAJORVERSION

Major version number.

GETVERSION-MINORVERSION

Monor version number.

GETVERSION-BUILDNUMBER

Build number.

GETVERSION-WIN9X-VERSION

Windows 9x version.

GETVERSION-WIN9X-BUILDNUMBER

Windows 9x build number.

GETVERSION-PLATFORMID

Platform ID; whether Windows NT or 9x based.

GETVERSION-TEXT

Version-dependent additional text.

WIN32API-PARMS - Used in all GSWINAPI calls

This argument is standard for all CALLs to GSWINAPI. It is used to select the desired API or function, and to return the status of the operation.

WIN32API-RC

Used to return the status of a call to GSWINAPI.  A value of zero is a failure, any other value indicates success.

Recommended usage is to test the 88-level value WIN32API to see if it worked, then to use the text error message to see why it failed.

* ------------------------: If function failed,
*                         :   display the error in a message box.
*
     IF WIN32API-FAILED
       MOVE WIN32API-ERROR-TEXT TO panel-MESSAGE-TEXT
       SET panel-MESSAGE-IN-MESSAGEBOX TO TRUE.

WIN32API-ERROR-CODE

Error code that was returned by Windows.  This is not generally useful unless you have the Windows Platform SDK documentation available to you.

WIN32API-ERROR-TEXT

Plain-text error message that describes why the operation failed.

WIN32API-A through WIN32API-F

The number of these present varies depending on how many arguments are used by the desired function.  These are not used, but must be present because this CALL requires seven arguments.


2000-2006 Norcom, all rights reserved 

TOC

Send feedback to Norcom