即使Windows 10显示应用程序并且进程未在兼容模式下运行,GetVersionEx也会将版本作为Windows 7返回 [英] GetVersionEx returns version as Windows 7 even if application is manifested for Windows 10 and process is not running in compatibility mode

查看:232
本文介绍了即使Windows 10显示应用程序并且进程未在兼容模式下运行,GetVersionEx也会将版本作为Windows 7返回的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我是在Windows 10系统上运行的最终用户(我知道,因为我的其他相关流程已将操作系统确定为Windows 10)。

Hi all, I've end users who are running on Windows 10 systems (I know that definitely since my other related processes have determined OS as Windows 10).

当我的进程运行时,它使用GetVersionEx来确定Windows的版本,并将结果版本作为6.2(对于其他用户为6.3)。

When my process runs, it uses GetVersionEx to determine version of Windows and gets resulted version as 6.2 (for other users as 6.3).

此EXE表现为Windows 10并用C ++编写。

This EXE is manifested for Windows 10 and written in C++.

现在这个程序我知道不是在兼容模式下运行,因为它每次都出现在一个随机位置,并且用户不可能去那个位置并更改兼容性设置。由于它是一个短暂的过程并立即被删除

Now this program I know is not running in compatibility mode since it is present at a random location every time and there is no possibility that user goes to that location and changes compatibility settings. Since it is a short lived process and gets deleted immediately.

我没有在所有Windows 10系统上报告此问题,只有少数用户报告它。


I'm not seeing this issue reported on all Windows 10 systems only few users are reporting it.

有人可以根据以上信息建议为什么GetVersionEx会返回错误版本的Windows?

Can some one please suggest based on above information why GetVersionEx returns incorrect version of Windows?

Sameer Thigale

Sameer Thigale

推荐答案

嗨Sameer,

Hi Sameer,

根据关于
的msdn文档GetVersionExA
,"GetVersionEx可能会因Windows 8.1之后的版本而被更改或不可用"。"
"随着Windows 8.1的发布,GetVersionEx API的行为在值中发生了变化它将返回操作系统版本。 GetVersionEx函数返回的值现在取决于应用程序的显示方式。"

"未显示Windows 8.1或Windows 10的应用程序将返回Windows 8操作系统版本值(6.2)。一旦应用程序显示给定的操作系统版本,GetVersionEx将始终返回应用程序在将来版本中显示的版本
。" 

显示Windows应用程序8.1或Windows 10,请参阅
定位Windows应用程序

According to the msdn doc about GetVersionExA, "GetVersionEx may be altered or unavailable for releases after Windows 8.1."
"With the release of Windows 8.1, the behavior of the GetVersionEx API has changed in the value it will return for the operating system version. The value returned by the GetVersionEx function now depends on how the application is manifested."
"Applications not manifested for Windows 8.1 or Windows 10 will return the Windows 8 OS version value (6.2). Once an application is manifested for a given operating system version, GetVersionEx will always return the version that the application is manifested for in future releases." 
To manifest your applications for Windows 8.1 or Windows 10, refer to Targeting your application for Windows.





祝你好运,

Best regards,


Drake

Drake


这篇关于即使Windows 10显示应用程序并且进程未在兼容模式下运行,GetVersionEx也会将版本作为Windows 7返回的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆