test - yamaumima/hello.github.io GitHub Wiki
// ChatDlg.cpp : implementation file
//
#include "stdafx.h" #include "Test.h" #include "ChatDlg.h"
#ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = FILE; #endif
///////////////////////////////////////////////////////////////////////////// // CChatDlg dialog
CChatDlg::CChatDlg(CWnd* pParent /=NULL/) : CDialog(CChatDlg::IDD, pParent) { //{{AFX_DATA_INIT(CChatDlg) // NOTE: the ClassWizard will add member initialization here //}}AFX_DATA_INIT }
void CChatDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CChatDlg) // NOTE: the ClassWizard will add DDX and DDV calls here //}}AFX_DATA_MAP }
BEGIN_MESSAGE_MAP(CChatDlg, CDialog) //{{AFX_MSG_MAP(CChatDlg) ON_WM_SETCURSOR() //}}AFX_MSG_MAP END_MESSAGE_MAP()
///////////////////////////////////////////////////////////////////////////// // CChatDlg message handlers
void CChatDlg::OnCancel() { this ->DestroyWindow(); // EndDialog(IDCANCEL); }
void CChatDlg::OnOK() { CWnd* pMainWnd = AfxGetMainWnd();
EndDialog(IDOK);
}
BOOL CChatDlg::OnInitDialog() { CDialog::OnInitDialog();
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
} extern CTestApp theApp; #ifndef IDC_HAND #define IDC_HAND MAKEINTRESOURCE(32649) #endif BOOL CChatDlg::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message) { if(pWnd == this) { HCURSOR hCur = theApp.LoadStandardCursor(IDC_CROSS); SetCursor(hCur); return TRUE; } switch(pWnd ->GetDlgCtrlID()) { case IDOK: case IDCANCEL: { HCURSOR hCur = theApp.LoadStandardCursor(IDC_HAND); SetCursor(hCur); return TRUE; }
}
return CDialog::OnSetCursor(pWnd, nHitTest, message);//设置系统缺省光标
}