📄 mydlg.cpp
字号:
// MyDlg.cpp : implementation file
//
#include "stdafx.h"
#include "MousePoint.h"
#include "MyDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// MyDlg dialog
MyDlg::MyDlg(CWnd* pParent /*=NULL*/)
: CDialog(MyDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(MyDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void MyDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(MyDlg)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(MyDlg, CDialog)
//{{AFX_MSG_MAP(MyDlg)
ON_WM_LBUTTONDOWN()
ON_WM_LBUTTONUP()
ON_WM_RBUTTONDOWN()
ON_WM_RBUTTONUP()
ON_WM_MOUSEMOVE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// MyDlg message handlers
void MyDlg::OnLButtonDown(UINT nFlags, CPoint point)
{
SetDlgItemText(IDC_L,"Down");
// TODO: Add your message handler code here and/or call default
CDialog::OnLButtonDown(nFlags, point);
}
void MyDlg::OnLButtonUp(UINT nFlags, CPoint point)
{
SetDlgItemText(IDC_L,"Up");
// TODO: Add your message handler code here and/or call default
CDialog::OnLButtonUp(nFlags, point);
}
void MyDlg::OnRButtonDown(UINT nFlags, CPoint point)
{
SetDlgItemText(IDC_R,"Down");
// TODO: Add your message handler code here and/or call default
CDialog::OnRButtonDown(nFlags, point);
}
void MyDlg::OnRButtonUp(UINT nFlags, CPoint point)
{
SetDlgItemText(IDC_R,"Up");
// TODO: Add your message handler code here and/or call default
CDialog::OnRButtonUp(nFlags, point);
}
void MyDlg::OnMouseMove(UINT nFlags, CPoint point)
{
CString str;
str.Format("%d",point.x);
SetDlgItemText(IDC_X,str);
str.Format("%d",point.y);
SetDlgItemText(IDC_Y,str);
// TODO: Add your message handler code here and/or call default
CDialog::OnMouseMove(nFlags, point);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -