?? mapi smsdlg.cpp
字號:
#include "stdafx.h"
#include "resource.h"
#include "MAPI SMSDlg.h"
// Okay so we cheat a bit here so I could avoid creating one header file.
extern BOOL DoSendMessage(LPCTSTR lpszFrom, LPCTSTR lpszTo, LPCTSTR lpszMessage);
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMAPISMSDlg dialog
CMAPISMSDlg::CMAPISMSDlg(CWnd* pParent /*=NULL*/)
: CDialog(CMAPISMSDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CMAPISMSDlg)
m_strFrom = _T("");
m_strMessage = _T("");
m_strTo = _T("");
//}}AFX_DATA_INIT
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}
void CMAPISMSDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CMAPISMSDlg)
DDX_Text(pDX, IDC_FROM, m_strFrom);
DDX_Text(pDX, IDC_MESSAGE, m_strMessage);
DDX_Text(pDX, IDC_TO, m_strTo);
//}}AFX_DATA_MAP
if (pDX->m_bSaveAndValidate)
{
// if we are saving the changes we need to validate our data
if (m_strFrom.IsEmpty())
{
AfxMessageBox(IDS_FROM_BLANK);
AfxThrowUserException();
}
if (m_strTo.IsEmpty())
{
AfxMessageBox(IDS_TO_BLANK);
AfxThrowUserException();
}
if (m_strMessage.IsEmpty())
{
AfxMessageBox(IDS_MESSAGE_BLANK);
AfxThrowUserException();
}
if (m_strMessage.GetLength() > 159)
{
AfxMessageBox(IDS_MESSAGE_TOOLONG);
AfxThrowUserException();
}
}
}
BEGIN_MESSAGE_MAP(CMAPISMSDlg, CDialog)
//{{AFX_MSG_MAP(CMAPISMSDlg)
ON_BN_CLICKED(IDC_SENDMESSAGE, OnSendmessage)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMAPISMSDlg message handlers
BOOL CMAPISMSDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
CenterWindow(GetDesktopWindow()); // center to the hpc screen
// TODO: Add extra initialization here
return TRUE; // return TRUE unless you set the focus to a control
}
void CMAPISMSDlg::OnSendmessage()
{
if (UpdateData(TRUE))
{
DoSendMessage(m_strFrom, m_strTo, m_strMessage);
}
else
; // Error should have already been reported in DoDataExchange
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -