home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 23 / IOPROG_23.ISO / SOFT / MSGTRACE.ZIP / MyProjects / MsgTrace / MsgTracer / MsgTracerProcess.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-05-30  |  2.8 KB  |  92 lines

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // File        : MsgTracerProcess.h
  4. // Project     : MsgTrace
  5. // Component   : MsgTracer
  6. //---------------------------------------------------------------------------
  7. // Description : describes an attached process
  8. //
  9. /////////////////////////////////////////////////////////////////////////////
  10. //
  11. // SourceSafe Strings. Do not change.
  12. //---------------------------------------------------------------------------
  13. // $Author: jeskes $
  14. // $Date: $
  15. // $Revision: $
  16. //
  17. /////////////////////////////////////////////////////////////////////////////
  18.  
  19. #ifndef MSGTRACERPROCESS_H
  20. #define MSGTRACERPROCESS_H
  21.  
  22. /////////////////////////////////////////////////////////////////////////////
  23.  
  24. class CMsgTracerProcessList;
  25.  
  26. /////////////////////////////////////////////////////////////////////////////
  27.  
  28. class CMsgTracerProcess : public CObject
  29. {
  30. //---------------------------------------------------------------------------
  31. // construction
  32. //---------------------------------------------------------------------------
  33. public:
  34.     CMsgTracerProcess( CMsgTracerProcessList* pOwner, DWORD dwProcessId );
  35.  
  36.     virtual ~CMsgTracerProcess();
  37.  
  38. //---------------------------------------------------------------------------
  39. // attributes
  40. //---------------------------------------------------------------------------
  41. protected:
  42.     CMsgTracerProcessList* m_pOwner;
  43.     DWORD m_dwProcessId;
  44.     HANDLE m_hProcess;
  45.  
  46.     CString m_sBaseName;
  47.  
  48. public:
  49.     DWORD GetProcessId() const;
  50.     HANDLE GetProcessHandle() const;
  51.     CString GetBaseName() const;
  52.  
  53. //---------------------------------------------------------------------------
  54. // operations
  55. //---------------------------------------------------------------------------
  56. public:
  57.     BOOL OpenProcess();
  58.     BOOL AttachProcess();
  59.     BOOL TerminateProcess();
  60.     void OnTerminateProcess( BOOL bAutoDelete = TRUE );
  61. };
  62.  
  63. /////////////////////////////////////////////////////////////////////////////
  64.  
  65. class CMsgTracerProcessList : public CObList
  66. {
  67. //---------------------------------------------------------------------------
  68. // construction
  69. //---------------------------------------------------------------------------
  70. public:
  71.     CMsgTracerProcessList();
  72.     virtual ~CMsgTracerProcessList();
  73.  
  74.     static void CreateItem( DWORD dwProcessId );
  75.     static void Init();
  76.  
  77. //---------------------------------------------------------------------------
  78. // item management
  79. //---------------------------------------------------------------------------
  80. public:
  81.     POSITION Add( DWORD dwProcessId, CMsgTracerProcess** pp = NULL );
  82.     CMsgTracerProcess* GetNext( POSITION& pos );
  83.     void Remove( CMsgTracerProcess* );
  84.  
  85.     CMsgTracerProcess* Find( DWORD dwProcessId );
  86.  
  87.     void TerminateAll();
  88. };
  89.  
  90. /////////////////////////////////////////////////////////////////////////////
  91. #endif
  92.