home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / winfe / sysinfo.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  2.7 KB  |  115 lines

  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2.  *
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  *
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  *
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18.  
  19. #ifndef __CSysInfo_H
  20. #define __CSysInfo_H
  21.  
  22. class CSysInfo    {
  23. //    Classification of the operating system.
  24. public:
  25.     BOOL m_bWin16;    //    3.1, WFW
  26.     BOOL m_bWin32;    //    Win32s, WinNT, Win95
  27.     BOOL m_bWin32s;
  28.     BOOL m_bWinNT;
  29.     BOOL m_bWin4;
  30.     BOOL m_bDBCS;   // double byte enable
  31.  
  32. //    Need an easy way to determine if under 4.0 and
  33. //        if a 32 bit app.
  34. public:
  35.     BOOL IsWin4_32() const    {
  36.         return(m_bWin32 == TRUE && m_bWin4 == TRUE);
  37.     }
  38.     BOOL IsWin4_16() const    {
  39.         return(m_bWin16 == TRUE && m_bWin4 == TRUE);
  40.     }
  41.     BOOL IsWin4() const    {
  42.         TRACE("Consider using IsWin4_32.\n");
  43.         return(m_bWin4 == TRUE);
  44.     }
  45.  
  46. //    Versioning information.
  47. //    These are (DWORD)-1 if not initalized.
  48. public:
  49.     DWORD m_dwMajor;
  50.     DWORD m_dwMinor;
  51.     DWORD m_dwBuild;
  52.  
  53. //    Cached colors, brushes, whatever.
  54. //    Usually defined by the OS.
  55. public:
  56.     HBRUSH    m_hbrBtnFace;
  57.     HBRUSH    m_hbrMenu;
  58.     HBRUSH  m_hbrHighlight;
  59.  
  60.     COLORREF m_clrBtnFace;
  61.     COLORREF m_clrBtnShadow;
  62.     COLORREF m_clrBtnHilite;
  63.     COLORREF m_clrBtnText;
  64.     COLORREF m_clrMenu;
  65.     COLORREF m_clrHighlight;
  66.  
  67. // Bits per pixel
  68.     int m_iBitsPerPixel;
  69.  
  70. //    Winsock information.
  71. public:
  72.     WSADATA m_wsaData;
  73.     int m_iMaxSockets;
  74.  
  75. //    Various window attributes.
  76. //    Such as the border size (WS_BORDER).
  77. public:
  78.     int m_iBorderWidth;
  79.     int m_iBorderHeight;
  80.     int m_iScrollWidth;
  81.     int m_iScrollHeight;
  82.  
  83. //  Screen size information.
  84. public:
  85.     int m_iScreenWidth;
  86.     int m_iScreenHeight;
  87.  
  88. //  Is a printer installed?
  89. public:
  90.     BOOL m_bPrinter;
  91.  
  92. // Do we need to override size for Win95 tooltips?
  93. public:
  94.     BOOL m_bOverrideWin95Tooltips;
  95.  
  96. //    Init/Reinit/Destroy...
  97. public:
  98.     CSysInfo();
  99.     ~CSysInfo();
  100.     void UpdateInfo();
  101.  
  102. //  Watchers.
  103. private:
  104.     void *m_pWatchSettingChanges;
  105.     void *m_pWatchDeviceModeChanges;
  106.     void *m_pWatchDeviceChanges;
  107.  
  108. protected:
  109.     BOOL OverrideWin95ToolTips(void);
  110. };
  111.  
  112. extern CSysInfo sysInfo;
  113.  
  114. #endif // __CSysInfo_H
  115.