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:
@@ -1150,6 +1150,14 @@ wxString wxGetOsDescription()
|
||||
|
||||
#endif // !__DARWIN__
|
||||
|
||||
bool wxCheckOsVersion(int majorVsn, int minorVsn)
|
||||
{
|
||||
int majorCur, minorCur;
|
||||
wxGetOsVersion(&majorCur, &minorCur);
|
||||
|
||||
return majorCur > majorVsn || (majorCur == majorVsn && minorCur >= minorVsn);
|
||||
}
|
||||
|
||||
unsigned long wxGetProcessId()
|
||||
{
|
||||
return (unsigned long)getpid();
|
||||
|
Reference in New Issue
Block a user