home *** CD-ROM | disk | FTP | other *** search
/ Media Share 13 / mediashare_13.zip / mediashare_13 / ZIPPED / PROGRAM / WTJ9403.ZIP / WILDASS / SOURCE / DESKTOP.H < prev    next >
C/C++ Source or Header  |  1993-08-13  |  2KB  |  78 lines

  1. #ifndef _INC_DESKTOP_H
  2. #define _INC_DESKTOP_H
  3.  
  4. class CDesktopWindow : public CObject
  5. private:
  6.    HWND     m_hWnd;           // window handle
  7.    BOOL     m_fIsIconic;      // iconized flag
  8.    CString  m_strModuleName;  // module name of the task belonging to the window
  9.    HTASK    m_hTask;          // task handle of the task belonging to the window
  10.    CString  m_strExePath;     // exename of the file containing the module
  11.    CRect    m_rectWnd;        // window rect of this window
  12.    UINT     m_swState;        // showwindow state
  13.    //CString   m_strArguments;  // arguments when launched   
  14.    
  15. public:
  16.    CDesktopWindow();
  17.    CDesktopWindow( const char * pszExePath, HTASK hTask );
  18.    void Create( const char * pszExePath, HTASK hTask );
  19.    
  20.    HTASK HTask() const;
  21.    const char * ExePath() const;
  22.    UINT ShowState() const;
  23.    BOOL IsIconic() const;
  24.    const CRect& WindowRect() const;
  25.    void Move( BOOL fIconic, const CRect& rect );
  26.    void MoveIconic( const CRect& rect );
  27.    
  28.    void WndInfo( HWND hWnd, BOOL fIsIconic, const CRect& rectWnd /*, const char * pszModuleName*/ );
  29.    void DumpProfile( const char * pszTag, UINT idEntry );
  30.    BOOL ReadProfile( const char * pszTag, UINT idEntry );
  31.  
  32. private:   
  33.    // helper
  34.    // enum all windows
  35.    static BOOL CALLBACK __export EnumAllWindowsProc( HWND hWnd, LPARAM lParam );
  36.    
  37. }; 
  38.  
  39. class CDesktop : public CObList
  40. private:
  41.    CString  m_strName;     // name of this desktop
  42.       
  43.    static BOOL CALLBACK __export EnumWindowsProc( HWND hWnd, LPARAM lParam );
  44.    
  45.    void Close();
  46.    
  47. public:
  48.    CDesktop( const char * pszName );
  49.    CDesktop();
  50.    ~CDesktop();
  51.    
  52.    void Create();    // creates the list
  53.    
  54.    void PlayBack();
  55.    void Snapshot();   // calls create and dumps
  56.    
  57. private:
  58.    // Dump this desktop to the profile
  59.    void DumpProfile();
  60.    void ReadProfile();
  61.    
  62.    // find an item by using its exename
  63.    POSITION Find( const char * pszExeName );
  64.    
  65.    // avoid casts in usage  
  66.    CDesktopWindow*& GetNext( POSITION& rPos );
  67.    CDesktopWindow*  GetNext( POSITION& rPos ) const;
  68.    CDesktopWindow*& GetAt( POSITION pos );
  69.    CDesktopWindow*  GetAt( POSITION pos ) const;
  70.    
  71. };
  72.   
  73. #endif // _INC_DESKTOP_H
  74.  
  75.  
  76.