home *** CD-ROM | disk | FTP | other *** search
- /////////////////////////////////////////////////////////////////////////////
- //
- // File : AttachDlg.cpp
- // Project : MsgTrace
- // Component : MsgTracer
- //---------------------------------------------------------------------------
- // Description : attach a running process dialog
- //
- /////////////////////////////////////////////////////////////////////////////
- //
- // SourceSafe Strings. Do not change.
- //---------------------------------------------------------------------------
- // $Author: jeskes $
- // $Date: $
- // $Revision: $
- //
- /////////////////////////////////////////////////////////////////////////////
-
- #include "stdafx.h"
- #include "psapi.h"
-
- #include "MsgTracerApp.h"
- #include "MsgTracerProcess.h"
- #include "AttachDlg.h"
-
- /////////////////////////////////////////////////////////////////////////////
-
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
-
- /////////////////////////////////////////////////////////////////////////////
- // CAttachDlg
- /////////////////////////////////////////////////////////////////////////////
-
- BEGIN_MESSAGE_MAP(CAttachDlg, CDialog)
- //{{AFX_MSG_MAP(CAttachDlg)
- ON_BN_CLICKED(IDC_ATTACH, OnAttach)
- ON_BN_CLICKED(IDC_REFRESH, OnRefresh)
- ON_BN_CLICKED(IDC_TERMINATE, OnTerminate)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
-
- /////////////////////////////////////////////////////////////////////////////
- // CAttachDlg: construction
- /////////////////////////////////////////////////////////////////////////////
-
- CAttachDlg::CAttachDlg(CWnd* pParent ) :
-
- CDialog( CAttachDlg::IDD, pParent ),
- m_ctlAttachedList( m_ctlUnattachedList ),
- m_ctlUnattachedList( m_ctlAttachedList )
-
- {
- //{{AFX_DATA_INIT(CAttachDlg)
- //}}AFX_DATA_INIT
- }
-
- /////////////////////////////////////////////////////////////////////////////
-
- void CAttachDlg::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CAttachDlg)
- DDX_Control( pDX, IDC_ATTACHED_LIST, m_ctlAttachedList );
- DDX_Control( pDX, IDC_UNATTACHED_LIST, m_ctlUnattachedList );
- //}}AFX_DATA_MAP
- }
-
- /////////////////////////////////////////////////////////////////////////////
-
- BOOL CAttachDlg::OnInitDialog()
- {
- CDialog::OnInitDialog();
-
- OnRefresh();
-
- return( TRUE );
- }
-
- /////////////////////////////////////////////////////////////////////////////
- // CAttachDlg message handlers
- /////////////////////////////////////////////////////////////////////////////
-
- void CAttachDlg::OnAttach()
- {
- CWaitCursor wait;
- if( m_ctlUnattachedList.OnAttach() )
- {
- OnRefresh();
- }
- }
-
- /////////////////////////////////////////////////////////////////////////////
-
- void CAttachDlg::OnRefresh()
- {
- CWaitCursor wait;
- m_ctlAttachedList.Refresh();
- m_ctlUnattachedList.Refresh();
- }
-
- /////////////////////////////////////////////////////////////////////////////
-
- void CAttachDlg::OnTerminate()
- {
- CWaitCursor wait;
- if( m_ctlAttachedList.OnTerminate() || m_ctlUnattachedList.OnTerminate() )
- {
- OnRefresh();
- }
- }
-