⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 processwatcheddialog.cpp

📁 简单的vc编的查看系统进程的程序!!!可以给初学vc的朋友很好的启示
💻 CPP
字号:
// ProcessWatchedDialog.cpp : implementation file
//

#include "stdafx.h"
#include "processdir.h"
#include "ProcessWatchedDialog.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CProcessWatchedDialog dialog


CProcessWatchedDialog::CProcessWatchedDialog(CWnd* pParent /*=NULL*/)
	: CDialog(CProcessWatchedDialog::IDD, pParent)
{
	//{{AFX_DATA_INIT(CProcessWatchedDialog)
	m_strProcessWatched = _T("");
	//}}AFX_DATA_INIT
}


void CProcessWatchedDialog::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CProcessWatchedDialog)
	DDX_Text(pDX, IDC_EDIT1, m_strProcessWatched);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CProcessWatchedDialog, CDialog)
	//{{AFX_MSG_MAP(CProcessWatchedDialog)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CProcessWatchedDialog message handlers

void CProcessWatchedDialog::OnOK() 
{  
  GetDlgItemText(IDC_EDIT1,m_strProcessWatched);//由于DoDataExchange在CDialog::OnOK()中调用,
                                                //所以这里显式的将IDC_EDIT1和m_strProcessWatched关联一下
  if(m_strProcessWatched == _T(""))
  {
	AfxMessageBox("please input the name of the process that you want to watch,or press  cancel to exit",MB_OK);
    GetDlgItem(IDC_EDIT1)->SetFocus();
  }
  else
  {
	  CDialog::OnOK();
  }
}

BOOL CProcessWatchedDialog::OnInitDialog() 
{   
	
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	GetDlgItem(IDC_EDIT1)->SetFocus();
	//return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
    return FALSE;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -