Display Windows Version

Display Windows Version

Postby TimStone » Sat Jul 09, 2022 9:08 pm

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
TimStone
 
Posts: 2945
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Display Windows Version

Postby Jimmy » Sat Jul 09, 2022 10:00 pm

hi,

FiveWin have Funktion Windows()
Code: Select all  Expand view  RUN
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 view  RUN
  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
Jimmy
 
Posts: 1732
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: Display Windows Version

Postby Antonio Linares » Sun Jul 10, 2022 12:23 am

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: 42121
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Display Windows Version

Postby Antonio Linares » Sun Jul 10, 2022 5:49 am

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
Antonio Linares
Site Admin
 
Posts: 42121
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Display Windows Version

Postby TimStone » Mon Jul 11, 2022 6:17 pm

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
User avatar
TimStone
 
Posts: 2945
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 70 guests