📄 attachdlg.cpp
字号:
// AttachDlg.cpp : implementation file
//
#include "stdafx.h"
#include "smtp.h"
#include "AttachDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// AttachDlg dialog
AttachDlg::AttachDlg(CWnd* pParent /*=NULL*/)
: CDialog(AttachDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(AttachDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void AttachDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(AttachDlg)
DDX_Control(pDX, IDC_LIST_FILE, m_List);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(AttachDlg, CDialog)
//{{AFX_MSG_MAP(AttachDlg)
ON_BN_CLICKED(IDC_BUTTON_ADD, OnButtonAdd)
ON_BN_CLICKED(IDC_BUTTON_REMOVE, OnButtonRemove)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// AttachDlg message handlers
void AttachDlg::OnButtonAdd()
{
// TODO: Add your control notification handler code here
CFileDialog dlg(TRUE);
if (dlg.DoModal() == IDOK) {
((CListBox*) GetDlgItem(IDC_LIST_FILE)) -> AddString(dlg.GetPathName());
}
}
void AttachDlg::OnButtonRemove()
{
// TODO: Add your control notification handler code here
int nSel = ((CListBox*) GetDlgItem(IDC_LIST_FILE)) -> GetCurSel();
if (nSel != LB_ERR) {
((CListBox*) GetDlgItem(IDC_LIST_FILE)) -> DeleteString(nSel);
}
}
void AttachDlg::OnOK()
{
// TODO: Add extra validation here
CString str;
m_Files.RemoveAll();
for(int lp = 0; lp < m_List.GetCount(); lp++) {
m_List.GetText(lp, str);
m_Files.Add(str);
}
CDialog::OnOK();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -