Solved

Detecting Windows98

Posted on 1998-12-25
4
147 Views
Last Modified: 2010-04-04
I know how to detect Windows95 and WindowsNT but
how can I detect windows 98 is running.
The code I use is below.

Thanks Vincent
---------------------------------------
Var
OSVersionInfo : TOSVersionInfo;
Uitslag : String;

begin
  Uitslag := '';
  OSVersionInfo.dwOSVersionInfoSize := SizeOf(TOSVersionInfo);
  GetVersionEx(OSVersionInfo);

  case OSVersionInfo.dwPlatformID of
    VER_PLATFORM_WIN32_WINDOWS : Uitslag := 'Windows95';
    VER_PLATFORM_WIN32_NT : Uitslag := 'WindowsNT';
  end;
0
Comment
Question by:Vincentg
  • 2
4 Comments
 
LVL 5

Accepted Solution

by:
heathprovost earned 10 total points
ID: 1352911
The easiest thing to do is to use the minor build number contained in the OSVersionInfo structure as follows:

...
  VER_PLATFORM_WIN32_NT: Uitslag := 'WindowsNT';
end;
if (OSVersionInfo.dwMinorVersion = 10) and
   (Utslag = 'Windows95') then Utslag := 'Windows98';

ps.  This could be written much cleaner but you should get the idea.  Basically if the dwMinorVersion is 10 then you are on Win98.

Hope this helps
0
 
LVL 5

Expert Comment

by:heathprovost
ID: 1352912
I typoed the answer above - it should be 1.0 or 1, not 10 for the minorVersion
0
 
LVL 2

Expert Comment

by:danysz
ID: 1352913
here is a complete answer

   osVerInfo.dwOSVersionInfoSize := SizeOf( OSVERSIONINFO);
   GetVersionEx( osVerInfo);

   case osVerInfo.dwPlatformId of
      VER_PLATFORM_WIN32s:
         begin
            OSPlatform.Caption := STR_OS + Chr( 9) + 'Win32s';
         end;
      VER_PLATFORM_WIN32_WINDOWS:
         begin
            osVerInfo.dwBuildNumber := osVerInfo.dwBuildNumber and $0000FFFF;
            if (osVerInfo.dwMajorVersion > 4) or ((osVerInfo.dwMajorVersion = 4) and
               (osVerInfo.dwMinorVersion >= 10)) then
            begin
               mnuOSPlatform.Caption := STR_OS + Chr( 9) + 'Windows 98';
            end
            else
            begin
               mnuOSPlatform.Caption := STR_OS + Chr( 9) + 'Windows 95';
            end;
         end;
      VER_PLATFORM_WIN32_NT:
      begin
         mnuOSPlatform.Caption := STR_OS + Chr( 9) + 'Windows NT';
      end;
   end; {case}

0
 

Expert Comment

by:Yoni
ID: 1352914
You can also use the get version function. You can find an example on how to use it in the win32.hlp file on the delphi cd.
There's also source there on how to get the build numbers but it's in c++
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Connection between libmysql.dll and MySQL Versions 7 113
Delphi selector screen 2 85
can't find the executable in Simulator 1 101
Unique identifier on a terminal server (rdp) 4 67
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question