Add wxCheckOsVersion() to implement platform based OS version checks.

Windows implements VerifyVersionInfo api since Win2k. Starting with Windows 8.1 GetVersionEx is deprecated and may not return the expected version number if the application does not contain the correct compatibility information in its manifest. VerifyVersionInfo works independent of manifest in the executable (and is the recommend way to check).

Existing code may already use wxPlatformInfo::CheckOSVersion() so the method forwards the call to wxCheckOsVersion if initialized for the current system.
This commit is contained in:
Tobias Taschner
2015-08-06 11:32:38 +02:00
parent d8e291c27a
commit 2b3633b3c0
6 changed files with 58 additions and 7 deletions

View File

@@ -190,13 +190,7 @@ public:
{ return m_osVersionMinor; }
// return true if the OS version >= major.minor
bool CheckOSVersion(int major, int minor) const
{
return DoCheckVersion(GetOSMajorVersion(),
GetOSMinorVersion(),
major,
minor);
}
bool CheckOSVersion(int major, int minor) const;
int GetToolkitMajorVersion() const
{ return m_tkVersionMajor; }
@@ -300,6 +294,8 @@ protected:
return majorCur > major || (majorCur == major && minorCur >= minor);
}
bool m_initializedForCurrentPlatform;
void InitForCurrentPlatform();