?
Solved

detect if Windows is Vista or higher

Posted on 2009-12-24
3
Medium Priority
?
412 Views
Last Modified: 2012-05-08
I need to detect in a Delphi application is the Windows OS is Vista or higher, or not.
The simple code the best
Thanks
0
Comment
Question by:LeTay
3 Comments
 
LVL 23

Accepted Solution

by:
Ferruccio Accalai earned 2000 total points
ID: 26118300
As simple as I can
procedure TForm1.Button1Click(Sender: TObject);
  function WichOsVersion: String;
  begin
    If (Win32Platform = VER_PLATFORM_WIN32_NT) and (Win32MajorVersion > 5) then
    begin
      If (Win32Platform = VER_PLATFORM_WIN32_NT) and (Win32MinorVersion < 1) then
        result := 'Windows Vista'
      else
        result := 'Windows 7 or higher';
    end
    else
    begin
      result := 'Lower than Windows Vista';
    end;
  end;
begin
  ShowMessage(WichOsVersion);
end;

Open in new window

0
 
LVL 4

Expert Comment

by:urban_smurf
ID: 26118388
Hi LeTay,
On Vista SysUtils.Win32MajorVersion = 6
You can find a really detailed article about OS detection here:
http://www.delphidabbler.com/articles?article=23&part=2#tosinfo-platform

Hope that helps, if you need an example i can provide one for you.
0
 

Author Closing Comment

by:LeTay
ID: 31669731
Faster answer than your is impossible !
Many thanks and Merry Christmas !
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses
Course of the Month14 days, 13 hours left to enroll

840 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