forked from mvdhout1992/cnc-ddraw
-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add workaround for alt+tab issues on windows 7 SP1 (opengl)
- Loading branch information
1 parent
8d97550
commit 64c4b73
Showing
3 changed files
with
124 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
/** | ||
* This file is part of the mingw-w64 runtime package. | ||
* No warranty is given; refer to the file DISCLAIMER within this package. | ||
*/ | ||
|
||
#ifndef _INC_VERSIONHELPERS | ||
#define _INC_VERSIONHELPERS | ||
|
||
#if 1 | ||
|
||
#ifdef __cplusplus | ||
#define VERSIONHELPERAPI inline bool | ||
#else | ||
#define VERSIONHELPERAPI FORCEINLINE BOOL | ||
#endif | ||
|
||
#ifndef _WIN32_WINNT_WIN8 | ||
#define _WIN32_WINNT_WIN8 0x0602 | ||
#endif | ||
#ifndef _WIN32_WINNT_WINBLUE | ||
#define _WIN32_WINNT_WINBLUE 0x0603 | ||
#endif | ||
#ifndef _WIN32_WINNT_WINTHRESHOLD | ||
#define _WIN32_WINNT_WINTHRESHOLD 0x0A00 /* ABRACADABRA_THRESHOLD*/ | ||
#endif | ||
#ifndef _WIN32_WINNT_WIN10 | ||
#define _WIN32_WINNT_WIN10 0x0A00 /* ABRACADABRA_THRESHOLD*/ | ||
#endif | ||
|
||
VERSIONHELPERAPI IsWindowsVersionOrGreater(WORD major, WORD minor, WORD servpack) | ||
{ | ||
OSVERSIONINFOEXW vi = {sizeof(vi),major,minor,0,0,{0},servpack}; | ||
return VerifyVersionInfoW(&vi, VER_MAJORVERSION|VER_MINORVERSION|VER_SERVICEPACKMAJOR, | ||
VerSetConditionMask(VerSetConditionMask(VerSetConditionMask(0, | ||
VER_MAJORVERSION,VER_GREATER_EQUAL), | ||
VER_MINORVERSION,VER_GREATER_EQUAL), | ||
VER_SERVICEPACKMAJOR, VER_GREATER_EQUAL)); | ||
} | ||
|
||
VERSIONHELPERAPI IsWindowsXPOrGreater(void) { | ||
return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINXP), LOBYTE(_WIN32_WINNT_WINXP), 0); | ||
} | ||
|
||
VERSIONHELPERAPI IsWindowsXPSP1OrGreater(void) { | ||
return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINXP), LOBYTE(_WIN32_WINNT_WINXP), 1); | ||
} | ||
|
||
VERSIONHELPERAPI IsWindowsXPSP2OrGreater(void) { | ||
return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINXP), LOBYTE(_WIN32_WINNT_WINXP), 2); | ||
} | ||
|
||
VERSIONHELPERAPI IsWindowsXPSP3OrGreater(void) { | ||
return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINXP), LOBYTE(_WIN32_WINNT_WINXP), 3); | ||
} | ||
|
||
VERSIONHELPERAPI IsWindowsVistaOrGreater(void) { | ||
return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_VISTA), LOBYTE(_WIN32_WINNT_VISTA), 0); | ||
} | ||
|
||
VERSIONHELPERAPI IsWindowsVistaSP1OrGreater(void) { | ||
return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_VISTA), LOBYTE(_WIN32_WINNT_VISTA), 1); | ||
} | ||
|
||
VERSIONHELPERAPI IsWindowsVistaSP2OrGreater(void) { | ||
return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_VISTA), LOBYTE(_WIN32_WINNT_VISTA), 2); | ||
} | ||
|
||
VERSIONHELPERAPI IsWindows7OrGreater(void) { | ||
return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WIN7), LOBYTE(_WIN32_WINNT_WIN7), 0); | ||
} | ||
|
||
VERSIONHELPERAPI IsWindows7SP1OrGreater(void) { | ||
return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WIN7), LOBYTE(_WIN32_WINNT_WIN7), 1); | ||
} | ||
|
||
VERSIONHELPERAPI IsWindows8OrGreater(void) { | ||
return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WIN8), LOBYTE(_WIN32_WINNT_WIN8), 0); | ||
} | ||
|
||
VERSIONHELPERAPI IsWindows8Point1OrGreater(void) { | ||
return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINBLUE), LOBYTE(_WIN32_WINNT_WINBLUE), 0); | ||
} | ||
|
||
VERSIONHELPERAPI IsWindowsThresholdOrGreater(void) { | ||
return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINTHRESHOLD), LOBYTE(_WIN32_WINNT_WINTHRESHOLD), 0); | ||
} | ||
|
||
VERSIONHELPERAPI IsWindows10OrGreater(void) { | ||
return IsWindowsThresholdOrGreater(); | ||
} | ||
|
||
VERSIONHELPERAPI IsWindowsServer(void) { | ||
OSVERSIONINFOEXW vi = {sizeof(vi),0,0,0,0,{0},0,0,0,VER_NT_WORKSTATION}; | ||
return !VerifyVersionInfoW(&vi, VER_PRODUCT_TYPE, VerSetConditionMask(0, VER_PRODUCT_TYPE, VER_EQUAL)); | ||
} | ||
|
||
#endif | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters