home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ocl150a.zip / OCL / Source / OSysInfo.cpp < prev    next >
C/C++ Source or Header  |  1996-08-12  |  2KB  |  82 lines

  1. // OCL - OS/2 Class Library
  2. // (c) Cubus 1995
  3. // All Rights Reserved
  4. // OSysInfo.cpp
  5. // System Utility Functions
  6.  
  7. // class member functions
  8.  
  9.  
  10. /*
  11.  * Redistribution and use in source and binary forms, with or without
  12.  * modification, are permitted provided that the following conditions
  13.  * are met:
  14.  * 1. Redistributions of source code must retain the above copyright
  15.  *    notice, this list of conditions and the following disclaimer.
  16.  * 2. Neither the name Cubus nor the name Team OCL may be used to
  17.  *    endorse or promote products derived from this software
  18.  *    without specific prior written permission.
  19.  * 3. See OCL.INF for a detailed copyright notice.
  20.  *
  21.  *              THIS SOFTWARE IS PROVIDED ``AS IS'' AND
  22.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  23.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  24.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  25.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  26.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  27.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  28.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  29.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  30.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  31.  * SUCH DAMAGE.
  32.  */
  33.  
  34. // $Header: W:/Projects/OCL/Source/rcs/OSysInfo.cpp 1.50 1996/08/11 23:49:32 B.STEIN Release $
  35.  
  36. #define __OCL_SOURCE__
  37.  
  38. #define OINCL_OSTRING
  39. #define OINCL_BASE
  40.  
  41. #include <ocl.hpp>
  42. #include <OProfile.hpp>
  43. #include <OSysInfo.hpp>
  44.  
  45. // Class OSysInfo
  46.  
  47.  
  48. OSysInfo::OSysInfo()
  49.   {}
  50.  
  51. OSysInfo::~OSysInfo()
  52.   {}
  53.  
  54.  
  55. PSZ OSysInfo::isOfType() const
  56.  return("OSysInfo"); 
  57. }
  58.  
  59.  
  60. BOOL OSysInfo::getDesktop()
  61. {
  62.  HOBJECT  hObject = WinQueryObject("<WP_DESKTOP>");
  63.  OProfile ini(HINI_SYSTEM);
  64.  pOString str;
  65.  BOOL     succ = FALSE;
  66.  
  67.  ini.getKeys("FolderWorkareaRunningObjects");
  68.  str = ini.list.getFirst();
  69.  while(str) {
  70.    HOBJECT desktop = WinQueryObject(str->getText());
  71.    if (desktop == hObject) {
  72.      SysInfoVar << str->getText();
  73.      succ = TRUE;
  74.      break; }
  75.    str = ini.list.getNext(); }
  76.  return(succ);
  77. }
  78.  
  79.  
  80. // end of source
  81.