Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 994977
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T06:39:02+00:00 2026-05-16T06:39:02+00:00

how to implement a function that will return the OS name? detect the environment

  • 0

how to implement a function that will return the OS name? detect the environment where the program running on?

win2000/xp/vista/win7 etc…?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T06:39:03+00:00Added an answer on May 16, 2026 at 6:39 am

    Something like this:

    function osver: string;
    begin
      result := 'Unknown (Windows ' + IntToStr(Win32MajorVersion) + '.' + IntToStr(Win32MinorVersion) + ')';
      case Win32MajorVersion of
        4:
          case Win32MinorVersion of
            0: result := 'Windows 95';
            10: result := 'Windows 98';
            90: result := 'Windows ME';
          end;
        5:
          case Win32MinorVersion of
            0: result := 'Windows 2000';
            1: result := 'Windows XP';
          end;
        6:
          case Win32MinorVersion of
            0: result := 'Windows Vista';
            1: result := 'Windows 7';
            2: result := 'Windows 8';
            3: result := 'Windows 8.1';
          end;
        10:
          case Win32MinorVersion of
            0: result := 'Windows 10';
          end;
      end;
    end;
    

    There is really no need to call GetVersionEx because SysUtils.pas has InitPlatformID in its initialization clause. Hence the global constants Win32MajorVersion and Win32MinorVersion (and friends) will be populated already.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to implement a function that will return a list of ints the represent
I am trying to implement a function that will insert a new entry in
I'm trying to implement the following functionality; a function with no explicit return will
I have a search function within my program that looks for the name or
If we need to implement a function that takes an array of integers and
Let's say I want to implement a function that is supposed to process an
I'm using R5RS Scheme and I just want to implement a function that returns
I am trying to implement a simple C++ function that adds a node to
I would like to implement a function with R that removes repeated characters in
I'm trying to implement unit tests for function that uses imported external objects. For

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.