"Fossies" - the Fresh Open Source Software Archive

Member "AutoHotkey_L-1.1.33.09/source/os_version.h" (8 May 2021, 3247 Bytes) of package /windows/misc/AutoHotkey_L-1.1.33.09.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "os_version.h" see the Fossies "Dox" file reference documentation.

    1 #ifndef __OS_VERSION_H
    2 #define __OS_VERSION_H
    3 
    4 ///////////////////////////////////////////////////////////////////////////////
    5 //
    6 // AutoIt
    7 //
    8 // Copyright (C)1999-2003:
    9 //      - Jonathan Bennett <jon@hiddensoft.com>
   10 //      - Others listed at http://www.autoitscript.com/autoit3/docs/credits.htm
   11 //
   12 // This program is free software; you can redistribute it and/or modify
   13 // it under the terms of the GNU General Public License as published by
   14 // the Free Software Foundation; either version 2 of the License, or
   15 // (at your option) any later version.
   16 //
   17 ///////////////////////////////////////////////////////////////////////////////
   18 //
   19 // os_version.h
   20 //
   21 // A standalone class for easy checking of the OS version.
   22 //
   23 ///////////////////////////////////////////////////////////////////////////////
   24 
   25 
   26 // Includes
   27 #include <windows.h>
   28 
   29 class OS_Version
   30 {
   31 public:
   32     // Functions
   33     OS_Version() { Init(); }                                    // Constructor
   34     void    Init(void);                                         // Call first before use
   35 
   36 #ifdef CONFIG_WIN2K
   37     bool    IsWin2000(void) {return m_bWin2000;}                // Returns true if Win2000
   38 #else
   39     bool    IsWin2000(void) {return false;}
   40 #endif
   41     bool    IsWinXP(void) {return m_bWinXP;}                    // Returns true if WinXP
   42     bool    IsWin2003(void) {return m_bWin2003;}                // Returns true if Win2003
   43     bool    IsWinVista(void) {return m_bWinVista;}              // Returns true if WinVista (v1.0.44.13)
   44     bool    IsWin7(void) {return m_bWin7; }                     // Returns true if Win7
   45     bool    IsWin8(void) {return m_bWin8; }                     // Returns true if Win8
   46     bool    IsWin8_1(void) {return m_bWin8_1; }                 // Returns true if Win8.1
   47 #ifdef CONFIG_WIN2K
   48     bool    IsWinXPorLater(void) {return m_bWinXPorLater;}      // Returns true if WinXP+
   49 #else
   50     bool    IsWinXPorLater(void) {return true;}
   51 #endif
   52     bool    IsWinVistaOrLater(void) {return m_bWinVistaOrLater;}// Returns true if WinVista or later (v1.0.48.01)
   53     bool    IsWin7OrLater(void) {return m_bWin7OrLater; }       // Returns true if Win7+
   54     bool    IsWin10OrLater(void) {return m_dwMajorVersion >= 10;} // Excludes early pre-release builds.
   55 
   56     DWORD   BuildNumber(void) {return m_dwBuildNumber;}
   57     //LPCTSTR CSD(void) {return m_szCSDVersion;}
   58     LPCTSTR Version() {return m_szVersion;}
   59 
   60 private:
   61     // Variables
   62     OSVERSIONINFOW  m_OSvi;                     // OS Version data
   63 
   64     DWORD           m_dwMajorVersion;           // Major OS version
   65     DWORD           m_dwMinorVersion;           // Minor OS version
   66     DWORD           m_dwBuildNumber;            // Build number
   67     //TCHAR         m_szCSDVersion[128];
   68     TCHAR           m_szVersion[32];            // "Major.Minor.Build" -- longest known number is 9 chars (plus terminator), but 32 should be future-proof.
   69 
   70 #ifdef CONFIG_WIN9X
   71     bool            m_bWinNT;
   72     bool            m_bWin9x;
   73 
   74     bool            m_bWin95;
   75     bool            m_bWin95orLater;
   76     bool            m_bWin98;
   77     bool            m_bWin98orLater;
   78     bool            m_bWinMe;
   79     bool            m_bWinMeorLater;
   80 #endif
   81 #ifdef CONFIG_WINNT4
   82     bool            m_bWinNT4;
   83     bool            m_bWinNT4orLater;
   84 #endif
   85 #ifdef CONFIG_WIN2K
   86     bool            m_bWin2000;
   87     bool            m_bWin2000orLater; // For simplicity, this is always left in even though it is not used when !(CONFIG_WIN9X || CONFIG_WINNT4).
   88     bool            m_bWinXPorLater;
   89 #endif
   90     bool            m_bWinXP;
   91     bool            m_bWin2003;
   92     bool            m_bWinVista;
   93     bool            m_bWinVistaOrLater;
   94     bool            m_bWin7;
   95     bool            m_bWin7OrLater;
   96     bool            m_bWin8;
   97     bool            m_bWin8_1;
   98 };
   99 
  100 ///////////////////////////////////////////////////////////////////////////////
  101 
  102 #endif
  103