Delphi-PRAXiS
Seite 1 von 2  1 2      

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Win32/Win64 API (native code) (https://www.delphipraxis.net/17-win32-win64-api-native-code/)
-   -   Delphi How to get Windows update number (https://www.delphipraxis.net/192353-how-get-windows-update-number.html)

WojTec 11. Apr 2017 14:03

How to get Windows update number
 
How to get Windows 8+ version number? I don't mean TOSVersionInfoEx.dwMajorVersion/TOSVersionInfoEx.dwMinorVersion but something like 1511 or 1607 on Windows 10 :?: This looks to be update version, I don't know how to name it exactly :?

And also I see in system info build number like this: (TOSVersionInfoEx.dwBuildNumber).953. Where to find the number after dot :?:

a.def 11. Apr 2017 14:05

AW: How to get Windows update number
 
I'm not sure but I think you have to get the version string from registry and parse it yourself.

Der schöne Günther 11. Apr 2017 15:36

AW: How to get Windows update number
 
Zitat:

In Windows 8.1 and Windows 10, the GetVersion and GetVersionEx functions have been deprecated. In Windows 10, the VerifyVersionInfo function has also been deprecated. While you can still call the deprecated functions, if your application does not specifically target Windows 8.1 or Windows 10, you will get Windows 8 version (6.2.0.0).
=> https://msdn.microsoft.com/de-de/lib...(v=vs.85).aspx

You will have to include the manifest stuff from that page into your application. Then
Delphi-Quellcode:
GetVersionEx(..)
will return the true build number.

HolgerX 11. Apr 2017 16:31

AW: How to get Windows update number
 
A simple option:

http://www.delphipraxis.net/1311524-post27.html

WojTec 11. Apr 2017 17:44

Re: How to get Windows update number
 
Yeah, with manifest old functions are working. But how to get OS version without manifest (I think check some file version from system is not real solution)?

BTW: if functions are deprecated, so why Delphi still uses it?:o:shock:

"Update number" I got from HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion: ReleaseId, but I think this is not real solution too.

Some ideas:?:

a.def 11. Apr 2017 17:49

AW: How to get Windows update number
 
Zitat:

"Update number" I got from HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion: ReleaseId, but I think this is not real solution too.
I do it the same way.

Normally the version number is written in registry. If not, the user changed it for sure and this is not the problem of a program creator.

Der schöne Günther 11. Apr 2017 17:53

AW: Re: How to get Windows update number
 
Zitat:

Zitat von WojTec (Beitrag 1367211)
Yeah, with manifest old functions are working. But how to get OS version without manifest

I'm puzzled. "Yeah, I can open that door with that key over there, but how can I open the door without the key?" :|

WojTec 11. Apr 2017 18:02

Re: AW: Re: How to get Windows update number
 
Zitat:

Zitat von Der schöne Günther (Beitrag 1367213)
I'm puzzled.

Why? This for sure will stop working some day, also MS told it's deprecated, so I'm looking for new solution :)

a.def 11. Apr 2017 18:32

AW: How to get Windows update number
 
Zitat:

Why? This for sure will stop working some day, also MS told it's deprecated, so I'm looking for new solution
Registry as long as it is working? ;)

Der schöne Günther 11. Apr 2017 18:33

AW: How to get Windows update number
 
I understand - It's about GetVersionEx being deprecated. Sorry :oops:

According to MS, the preferred solution is to use VerifyVersionInfo which (for now) behaves exactly the same except it returns a boolean whether the operating system matches your expectations rather than returning numbers.
Note that the "manifest stuff" still applies to VerifyVersionInfo. It's just not "deprecated", that's all.

This is also what the helper macros use, and they have been around for quite some time now.


Alle Zeitangaben in WEZ +1. Es ist jetzt 22:21 Uhr.
Seite 1 von 2  1 2      

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz