-1

This was pompted by a couple of recent questions where the answer amounted to "there seems to be no API for that" in both cases.

  • Retrieving Windows version "1511" was about retrieving the "Version 1511" string prominently displayed in the Help / About boxes of system apps from Notepad to MMC since the November update. The only proposed workaround was to read it off an undocumented registry key.

  • How to detect whether Windows 10 features are currently enabled in the console was about a console app detecting whether it's running under the "new" console (ForceV2=1) vs. the legacy console. An incomplete and unsatisfactory workaround (that I posted there) was to check whether the console window allows itself to be resized wider.

I would expect that there must be more cases of such new features that the published APIs haven't caught up with, yet. Examples welcome, references and known workarounds even better.

Community
  • 1
  • 1
dxiv
  • 16,984
  • 2
  • 27
  • 49
  • 1
    To whoever casted the first downvote to close this question as "*too broad*"... Yes, it *is* broad by the nature of the question. If there is a better suited place to post it, then by all means please advise. But it's definitely related to `winapi` and `windows-10`, which is what it's tagged as. I can point to loads of broader and way more vague questions that received high marks in the past, so I am not sure what's the perceived problem with this one in particular. – dxiv Dec 11 '15 at 05:20
  • Sigh. To whoever cast the second downvote for "*off-topic ... this question does not appear to be about programming*"... If `winapi` is not about "*programming*" in `windows-10` then I don't know what is. If you disagree, please suggest where to better ask questions like this, or the even more tenuous [Windows API for VISTA, 7 & Beyond](http://stackoverflow.com/questions/1149014/windows-api-for-vista-7-beyond) for that matter, which curiously enough seems to have been well received at the time, without challenges as far as I can see. – dxiv Dec 11 '15 at 07:34
  • 1
    You are asking for a list, which is deemed off topic here. Please don't pollute the comments of your own post with discussion of such meta issues. Please take this up of meta stack overflow. – David Heffernan Dec 11 '15 at 08:28

1 Answers1

0

The inability to obtain a version number is entirely intentional. Both GetVersion(Ex) and VerifyVersionInfo are deprecated, although they are still available for Windows desktop apps. The use of GetVersion(Ex) is strongly discourage, and VerifyVersionInfo should really only be used for you must be this high to ride this ride checks. See this post and this one.

Universal Windows apps have access to an opaque string for logs and telemetry, but apps shouldn't be trying to display a user-visible version number. See AnalyticsInfo.VersionInfo. In short, if you are UWP you already know you are on Windows 10. If you have hard dependencies on a particular version, that is handled through AppX manifest elements.

Chuck Walbourn
  • 38,259
  • 2
  • 58
  • 81
  • Your points are correct, but the question was about access and availability, rather than purpose of usage. Even for "1511", using it to "key" app behavior on is bad practice, as has always been. However, just for an example, maybe some app saved a logfile starting with `running under "???" v10.0.10586`. It would make sense to fill-in the `"???"` with a user-friendly string that matches MS apps' Help / About but there is no API to retrieve that string in the Nov update (that I am aware of). – dxiv Dec 11 '15 at 05:47
  • In a log file, the 10586 part is all you need to know. The "1511" string is just fluff. – Chuck Walbourn Dec 11 '15 at 16:09