www.gusucode.com > VC++模仿超炫Vista风格QQ界面-源码程序 > VC++模仿超炫Vista风格QQ界面/BeautyQQ/TalkDlg.cpp
// TalkDlg.cpp : implementation file // #include "stdafx.h" #include "BeautyQQ.h" #include "TalkDlg.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CTalkDlg dialog CTalkDlg::CTalkDlg(CWnd* pParent /*=NULL*/) : CDialog(CTalkDlg::IDD, pParent) { } void CTalkDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CTalkDlg) DDX_Control(pDX, IDC_BUTTON_SEND, m_btSend); DDX_Control(pDX, IDC_EDIT1, m_edit1); DDX_Control(pDX, IDC_EDIT2, m_edit2); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CTalkDlg, CDialog) //{{AFX_MSG_MAP(CTalkDlg) ON_BN_CLICKED(IDC_BUTTON_SEND, OnButtonSend) ON_BN_CLICKED(IDC_BUTTON_TALK_SM1, OnButtonTalkSm1) ON_BN_CLICKED(IDC_BUTTON_TALK_SM2, OnButtonTalkSm2) ON_BN_CLICKED(IDC_BUTTON_TALK_SERACH, OnButtonTalkSerach) ON_BN_CLICKED(IDC_BUTTON_TALK_FONT, OnButtonTalkFont) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CTalkDlg message handlers BOOL CTalkDlg::OnInitDialog() { CDialog::OnInitDialog(); //将该对话框绑定某资源ID,让其绘制根据该资源定义来实现 //bind with the predefine res BindRes2CtrlbyHWND(103,m_hWnd); //简单设置其大小,匹配资源背景图 //move the window to fit the size of the res MoveWindow(0,0,517,410); //居中显示 //center show CenterWindow(); VERIFY(m_tFont.CreateFont( 12, // nHeight 0, // nWidth 0, // nEscapement 0, // nOrientation FW_NORMAL, // nWeight FALSE, // bItalic FALSE, // bUnderline 0, // cStrikeOut ANSI_CHARSET, // nCharSet OUT_DEFAULT_PRECIS, // nOutPrecision CLIP_DEFAULT_PRECIS, // nClipPrecision DEFAULT_QUALITY, // nQuality DEFAULT_PITCH | FF_SWISS, // nPitchAndFamily _T("宋体"))); // lpszFacename //set all the ctrls font --as we expect m_edit1.SetFont(&m_tFont); m_edit2.SetFont(&m_tFont); m_btSend.SetFont(&m_tFont); this->SetFont(&m_tFont); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } void CTalkDlg::OnButtonSend() { MessageBox(_T("OnButtonSend")); } void CTalkDlg::OnButtonTalkSm1() { MessageBox(_T("OnButtonTalkSm1")); } void CTalkDlg::OnButtonTalkSm2() { MessageBox(_T("OnButtonTalkSm2")); } void CTalkDlg::OnButtonTalkSerach() { MessageBox(_T("OnButtonTalkSerach")); } void CTalkDlg::OnButtonTalkFont() { MessageBox(_T("OnButtonTalkFont")); }