Board index » delphi » How do you detect Windows version?

How do you detect Windows version?

Can a Delphi 2.0 app detect the Windows version?  Someone started my app under
WFW 3.11 - it said it couldn't find some things then locked up the system.  I
would much rather detect that I'm on a 16-bit OS and shut down gracefully.  I
can't find info about this and I don't have Win 3.x to test on here.  

What does something like Word 6.0 do when you try to run it under Win 3.x?

Thanks,
Mark Gardner

Directory Statistics - disk usage in tree format
http://www.mindspring.com/~danville/dirstats.html

 

Re:How do you detect Windows version?


Check the API help
In the WINPROCS unit try the function GetVersion: LongInt;

The GetVersion function retrieves the current version numbers of the
Windows and MS-DOS operation systems.

NOTE there is a error in the orginal API documentation, the major/minor
Win version are reversed!

As I have used it:
Windows 3.1 show up as 3.1, WIN95 shows up as 3.95

Other Threads