Solved

Detecting Windows98

Posted on 1998-12-25
4
137 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
Comment Utility
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
Comment Utility
I typoed the answer above - it should be 1.0 or 1, not 10 for the minorVersion
0
 
LVL 2

Expert Comment

by:danysz
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

771 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now