home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 242 / Issue 242 - April 2008 - DPCS0408DVD.ISO / Open Source / AutoHotKey / Source / AutoHotkey104705_source.exe / source / os_version.h < prev    next >
Encoding:
C/C++ Source or Header  |  2006-09-16  |  3.0 KB  |  90 lines

  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.     bool    IsWinNT(void) {return m_bWinNT;}                    // Returns true if NT/2k/XP and family.
  37.     bool    IsWin9x(void) {return m_bWin9x;}                    // Returns true if 9x
  38.  
  39.     bool    IsWinNT4(void) {return m_bWinNT4;}                    // Returns true if WinNT 4
  40.     bool    IsWin2000(void) {return m_bWin2000;}                // Returns true if Win2000
  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    IsWinNT4orLater(void) {return m_bWinNT4orLater;}    // Returns true if WinNT 4+
  45.     bool    IsWin2000orLater(void) {return m_bWin2000orLater;}    // Returns true if Win2000+
  46.     bool    IsWinXPorLater(void) {return m_bWinXPorLater;}        // Returns true if WinXP+
  47.  
  48.     bool    IsWin95(void) {return m_bWin95;}                    // Returns true if 95
  49.     bool    IsWin98(void) {return m_bWin98;}                    // Returns true if 98
  50.     bool    IsWinMe(void) {return m_bWinMe;}                    // Returns true if Me
  51.     bool    IsWin95orLater(void) {return m_bWin95orLater;}        // Returns true if 95
  52.     bool    IsWin98orLater(void) {return m_bWin98orLater;}        // Returns true if 98
  53.     bool    IsWinMeorLater(void) {return m_bWinMeorLater;}        // Returns true if Me
  54.  
  55.     DWORD    BuildNumber(void) {return m_dwBuildNumber;}
  56.     const char * CSD(void) {return m_szCSDVersion;}
  57.  
  58. private:
  59.     // Variables
  60.     OSVERSIONINFO    m_OSvi;                        // OS Version data
  61.  
  62.     DWORD            m_dwMajorVersion;            // Major OS version
  63.     DWORD            m_dwMinorVersion;            // Minor OS version
  64.     DWORD            m_dwBuildNumber;            // Build number
  65.     char            m_szCSDVersion [256];
  66.  
  67.     bool            m_bWinNT;
  68.     bool            m_bWin9x;
  69.  
  70.     bool            m_bWinNT4;
  71.     bool            m_bWinNT4orLater;
  72.     bool            m_bWinXP;
  73.     bool            m_bWin2003;
  74.     bool            m_bWinVista;
  75.     bool            m_bWinXPorLater;
  76.     bool            m_bWin2000;
  77.     bool            m_bWin2000orLater;
  78.     bool            m_bWin98;
  79.     bool            m_bWin98orLater;
  80.     bool            m_bWin95;
  81.     bool            m_bWin95orLater;
  82.     bool            m_bWinMe;
  83.     bool            m_bWinMeorLater;
  84. };
  85.  
  86. ///////////////////////////////////////////////////////////////////////////////
  87.  
  88. #endif
  89.  
  90.