FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Display Windows Version
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
Display Windows Version
Posted: Sat Jul 09, 2022 09: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
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: Display Windows Version
Posted: Sat Jul 09, 2022 10:00 PM
hi,

FiveWin have Funktion Windows()
Code (fw): Select all Collapse
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 (fw): Select all Collapse
   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
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Display Windows Version
Posted: 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
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Display Windows Version
Posted: Sun Jul 10, 2022 05: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
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
Re: Display Windows Version
Posted: Mon Jul 11, 2022 06: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

Continue the discussion