forked from Thomas-Mielke-Software/EasyCash
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWinVer.cpp
More file actions
83 lines (65 loc) · 2.21 KB
/
WinVer.cpp
File metadata and controls
83 lines (65 loc) · 2.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
// WinVer.cpp
//
// Diese Datei ist Bestandteil von EasyCash&Tax, der freien EÜR-Fibu
//
// Copyleft (GPLv3) 2020 Thomas Mielke
//
// Dies ist freie Software; Sie dürfen sie unter den Bedingungen der
// GNU General Public License, wie von der Free Software Foundation
// veröffentlicht, weiterverteilen und/oder modifizieren; entweder gemäß
// Version 3 der Lizenz oder (nach Ihrer Option) jeder späteren Version.
//
// Diese Software wird in der Hoffnung weiterverbreitet, dass sie nützlich
// sein wird, jedoch OHNE IRGENDEINE GARANTIE, auch ohne die implizierte
// Garantie der MARKTREIFE oder der VERWENDBARKEIT FÜR EINEN BESTIMMTEN ZWECK.
// Mehr Details finden Sie in der GNU Lesser General Public License.
//
// Sie sollten eine Kopie der GNU General Public License Version 3 zusammen mit
// dieser Software erhalten haben; falls nicht, schreiben Sie an die Free
// Software Foundation, Inc., 51 Franklin St, 5th Floor, Boston, MA 02110, USA.
#include "stdafx.h"
#include "WinVer.h"
BOOL Is2000OrGreater()
{
OSVERSIONINFO osinfo;
osinfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
GetVersionEx(&osinfo);
DWORD dwPlatformId = osinfo.dwPlatformId;
DWORD dwMajorVersion = osinfo.dwMajorVersion;
return ((dwPlatformId == 2) &&
(dwMajorVersion >= 5));
}
BOOL Is2000()
{
OSVERSIONINFO osinfo;
osinfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
GetVersionEx(&osinfo);
DWORD dwPlatformId = osinfo.dwPlatformId;
DWORD dwMajorVersion = osinfo.dwMajorVersion;
DWORD dwMinorVersion = osinfo.dwMinorVersion;
return ((dwPlatformId == 2) &&
(dwMajorVersion == 5) &&
(dwMinorVersion == 0));
}
BOOL IsXP()
{
OSVERSIONINFO osinfo;
osinfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
GetVersionEx(&osinfo);
DWORD dwPlatformId = osinfo.dwPlatformId;
DWORD dwMajorVersion = osinfo.dwMajorVersion;
DWORD dwMinorVersion = osinfo.dwMinorVersion;
return ((dwPlatformId == 2) &&
(dwMajorVersion == 5) &&
(dwMinorVersion >= 1));
}
BOOL IsVista()
{
OSVERSIONINFO osinfo;
osinfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
GetVersionEx(&osinfo);
DWORD dwPlatformId = osinfo.dwPlatformId;
DWORD dwMajorVersion = osinfo.dwMajorVersion;
return ((dwPlatformId == 2) &&
(dwMajorVersion >= 6));
}