Display Windows Version

Post Reply
User avatar
TimStone
Posts: 2956
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA
Has thanked: 25 times
Been thanked: 2 times
Contact:

Display Windows Version

Post by TimStone »

Somewhere I recall this may have been addressed but I can't find it.

On one of my dialogs, I want to display the version of Windows that the computer is using. I am testing this on a Windows 11 computer.

If I use either OS() or Windows( ) I get Version 8.

If I use GetVersion( ) and use the array values, I get Version 6.2.

What I want to display is Windows 8, 10, or 11, depending on what is actually running on the computer. Is this possible ?
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
Jimmy
Posts: 1740
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany
Has thanked: 2 times

Re: Display Windows Version

Post by Jimmy »

hi,

FiveWin have Funktion Windows()

Code: Select all | Expand

c:\fwh\source\function\getsysin.prg

but for Windows 10 you need "more" Information and Windows 11 is not include

---

for User :

FiveWin have ShellAbout()
https://docs.microsoft.com/en-us/windows/win32/api/shellapi/nf-shellapi-shellaboutw
it will display Windows About Dialog which show Windows Version

you can add a String, here "FiveWin", in Dialog-Box

For Developer :

i use these Registry Settings

Code: Select all | Expand

  a := RegistryRead( "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProductName" )
   b := RegistryRead( "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\CurrentBuild" )
   // Sub-Version
   c := LTRIM( STR( RegistryRead( "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\UBR" ) ) )
   d := RegistryRead( "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DisplayVersion" )

"c" give you Windows 10 "Sub-Version"

work from XP up to Windows 11 DEV
greeting,
Jimmy
User avatar
Antonio Linares
Site Admin
Posts: 42597
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 40 times
Been thanked: 86 times
Contact:

Re: Display Windows Version

Post by Antonio Linares »

Checking this:
https://stackoverflow.com/questions/69038560/detect-windows-11-with-net-framework-or-windows-api

We are going to update FWH to properly recognize Windows 11. Tomorrow, now its quite late here :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
Posts: 42597
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 40 times
Been thanked: 86 times
Contact:

Re: Display Windows Version

Post by Antonio Linares »

Please download FWH.exe and FWH64.exe again as we have already included support for Windows 11 in function cWinVersion()

Also there is a new function IsWindows11()

You can build and run FWH\samples\testerro.prg and see the Windows description in the generated log file

many thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
TimStone
Posts: 2956
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA
Has thanked: 25 times
Been thanked: 2 times
Contact:

Re: Display Windows Version

Post by TimStone »

Thank you. That works great.
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
Post Reply