home *** CD-ROM | disk | FTP | other *** search
- /////////////////////////////////////////////////////////////////////////////
- //
- // File : MsgTracerProcess.h
- // Project : MsgTrace
- // Component : MsgTracer
- //---------------------------------------------------------------------------
- // Description : describes an attached process
- //
- /////////////////////////////////////////////////////////////////////////////
- //
- // SourceSafe Strings. Do not change.
- //---------------------------------------------------------------------------
- // $Author: jeskes $
- // $Date: $
- // $Revision: $
- //
- /////////////////////////////////////////////////////////////////////////////
-
- #ifndef MSGTRACERPROCESS_H
- #define MSGTRACERPROCESS_H
-
- /////////////////////////////////////////////////////////////////////////////
-
- class CMsgTracerProcessList;
-
- /////////////////////////////////////////////////////////////////////////////
-
- class CMsgTracerProcess : public CObject
- {
- //---------------------------------------------------------------------------
- // construction
- //---------------------------------------------------------------------------
- public:
- CMsgTracerProcess( CMsgTracerProcessList* pOwner, DWORD dwProcessId );
-
- virtual ~CMsgTracerProcess();
-
- //---------------------------------------------------------------------------
- // attributes
- //---------------------------------------------------------------------------
- protected:
- CMsgTracerProcessList* m_pOwner;
- DWORD m_dwProcessId;
- HANDLE m_hProcess;
-
- CString m_sBaseName;
-
- public:
- DWORD GetProcessId() const;
- HANDLE GetProcessHandle() const;
- CString GetBaseName() const;
-
- //---------------------------------------------------------------------------
- // operations
- //---------------------------------------------------------------------------
- public:
- BOOL OpenProcess();
- BOOL AttachProcess();
- BOOL TerminateProcess();
- void OnTerminateProcess( BOOL bAutoDelete = TRUE );
- };
-
- /////////////////////////////////////////////////////////////////////////////
-
- class CMsgTracerProcessList : public CObList
- {
- //---------------------------------------------------------------------------
- // construction
- //---------------------------------------------------------------------------
- public:
- CMsgTracerProcessList();
- virtual ~CMsgTracerProcessList();
-
- static void CreateItem( DWORD dwProcessId );
- static void Init();
-
- //---------------------------------------------------------------------------
- // item management
- //---------------------------------------------------------------------------
- public:
- POSITION Add( DWORD dwProcessId, CMsgTracerProcess** pp = NULL );
- CMsgTracerProcess* GetNext( POSITION& pos );
- void Remove( CMsgTracerProcess* );
-
- CMsgTracerProcess* Find( DWORD dwProcessId );
-
- void TerminateAll();
- };
-
- /////////////////////////////////////////////////////////////////////////////
- #endif
-