-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathos_version.h
89 lines (74 loc) · 2.88 KB
/
os_version.h
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
84
85
86
87
88
#ifndef __OS_VERSION_H
#define __OS_VERSION_H
///////////////////////////////////////////////////////////////////////////////
//
// AutoIt
//
// Copyright (C)1999-2003:
// - Jonathan Bennett <jon@hiddensoft.com>
// - Others listed at http://www.autoitscript.com/autoit3/docs/credits.htm
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
///////////////////////////////////////////////////////////////////////////////
//
// os_version.h
//
// A standalone class for easy checking of the OS version.
//
///////////////////////////////////////////////////////////////////////////////
// Includes
#include <windows.h>
class OS_Version
{
public:
// Functions
OS_Version() { Init(); } // Constructor
void Init(void); // Call first before use
bool IsWinNT(void) {return m_bWinNT;} // Returns true if NT/2k/XP and family.
bool IsWin9x(void) {return m_bWin9x;} // Returns true if 9x
bool IsWinNT4(void) {return m_bWinNT4;} // Returns true if WinNT 4
bool IsWin2000(void) {return m_bWin2000;} // Returns true if Win2000
bool IsWinXP(void) {return m_bWinXP;} // Returns true if WinXP
bool IsWin2003(void) {return m_bWin2003;} // Returns true if Win2003
bool IsWinVista(void) {return m_bWinVista;} // Returns true if WinVista (v1.0.44.13)
bool IsWinNT4orLater(void) {return m_bWinNT4orLater;} // Returns true if WinNT 4+
bool IsWin2000orLater(void) {return m_bWin2000orLater;} // Returns true if Win2000+
bool IsWinXPorLater(void) {return m_bWinXPorLater;} // Returns true if WinXP+
bool IsWin95(void) {return m_bWin95;} // Returns true if 95
bool IsWin98(void) {return m_bWin98;} // Returns true if 98
bool IsWinMe(void) {return m_bWinMe;} // Returns true if Me
bool IsWin95orLater(void) {return m_bWin95orLater;} // Returns true if 95
bool IsWin98orLater(void) {return m_bWin98orLater;} // Returns true if 98
bool IsWinMeorLater(void) {return m_bWinMeorLater;} // Returns true if Me
DWORD BuildNumber(void) {return m_dwBuildNumber;}
const char * CSD(void) {return m_szCSDVersion;}
private:
// Variables
OSVERSIONINFO m_OSvi; // OS Version data
DWORD m_dwMajorVersion; // Major OS version
DWORD m_dwMinorVersion; // Minor OS version
DWORD m_dwBuildNumber; // Build number
char m_szCSDVersion [256];
bool m_bWinNT;
bool m_bWin9x;
bool m_bWinNT4;
bool m_bWinNT4orLater;
bool m_bWinXP;
bool m_bWin2003;
bool m_bWinVista;
bool m_bWinXPorLater;
bool m_bWin2000;
bool m_bWin2000orLater;
bool m_bWin98;
bool m_bWin98orLater;
bool m_bWin95;
bool m_bWin95orLater;
bool m_bWinMe;
bool m_bWinMeorLater;
};
///////////////////////////////////////////////////////////////////////////////
#endif