📄 processwatcheddialog.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 + -