summaryrefslogtreecommitdiff
path: root/alf/alfcompat.h
diff options
context:
space:
mode:
Diffstat (limited to 'alf/alfcompat.h')
-rw-r--r--alf/alfcompat.h65
1 files changed, 46 insertions, 19 deletions
diff --git a/alf/alfcompat.h b/alf/alfcompat.h
index 8186492..eeb70da 100644
--- a/alf/alfcompat.h
+++ b/alf/alfcompat.h
@@ -15,25 +15,6 @@ extern IMAGE_DOS_HEADER __ImageBase;
#endif
#define ALF_HINSTANCE ((HINSTANCE)&__ImageBase)
-static inline BOOL ALF_Compat_IsMinWindowsVersion(DWORD major, DWORD minor)
-{
- DWORD v = GetVersion();
- DWORD vMajor = LOBYTE(LOWORD(v));
- DWORD vMinor = HIBYTE(LOWORD(v));
-
- return vMajor > major || (vMajor == major && vMinor >= minor);
-}
-
-static inline BOOL ALF_Compat_IsWin9x(void)
-{
- return GetVersion() >= 0x80000000;
-}
-
-static inline BOOL ALF_Compat_IsWinNT(void)
-{
- return GetVersion() < 0x80000000;
-}
-
typedef struct {
UINT cbSize;
int iBorderWidth;
@@ -144,3 +125,49 @@ extern HRESULT (WINAPI *ALF_Compat_EndBufferedAnimation)(ALF_Compat_HANIMATIONBU
extern BOOL (WINAPI *ALF_Compat_BufferedPaintRenderAnimation)(HWND,HDC);
extern HRESULT (WINAPI *ALF_Compat_GetThemeTransitionDuration)(HTHEME,int,int,int,int,DWORD*);
extern HRESULT (WINAPI *ALF_Compat_GetThemeColor)(HTHEME,int,int,int,COLORREF*);
+
+// compatibility bits
+
+#define ALF_COMPAT_ISNT 1
+#define ALF_COMPAT_IS40 2
+#define ALF_COMPAT_ISW2K 4
+#define ALF_COMPAT_ISXP 8
+#define ALF_COMPAT_ISVISTA 16
+#define ALF_COMPAT_ISCOMCTLV6 32
+
+extern DWORD _alf_compatBits;
+
+static inline BOOL ALF_Compat_IsWin9x(void)
+{
+ return !(_alf_compatBits & ALF_COMPAT_ISNT);
+}
+
+static inline BOOL ALF_Compat_IsNT(void)
+{
+ return !!(_alf_compatBits & ALF_COMPAT_ISNT);
+}
+
+static inline BOOL ALF_Compat_Is40(void) // both NT 4.0 and Win95
+{
+ return !!(_alf_compatBits & ALF_COMPAT_IS40);
+}
+
+static inline BOOL ALF_Compat_Is2k(void)
+{
+ return !!(_alf_compatBits & ALF_COMPAT_ISW2K);
+}
+
+static inline BOOL ALF_Compat_IsXP(void)
+{
+ return !!(_alf_compatBits & ALF_COMPAT_ISXP);
+}
+
+static inline BOOL ALF_Compat_IsVista(void)
+{
+ return !!(_alf_compatBits & ALF_COMPAT_ISVISTA);
+}
+
+static inline BOOL ALF_Compat_IsComCtlV6(void)
+{
+ return !!(_alf_compatBits & ALF_COMPAT_ISCOMCTLV6);
+}