マウスが動くと動いた点の座標が取り出せるので,取り出した座標をm_sEdit1に表示する。マウスをクリックしたら新しい情報が取り出せるように,
| void CFreeWritingDlg::OnLButtonDown(UINT nFlags, CPoint point) |
| { |
| drawLine = TRUE; |
| pvPT.x =point.x - RelRect.left; |
| pvPT.y = point.y - RelRect.top; |
| temp = ""; |
| CDialog::OnLButtonDown(nFlags, point); |
| } |
| void CPaintDlg::OnMouseMove(UINT nFlags, CPoint point) |
| { |
| pDC- |
| pDC- |
| if(drawLine){ |
| point.x -= RelRect.left; |
| point.y -= RelRect.top; |
| temp.Format("%3d %3d |
| m_sEdit1 += temp; |
| UpdateData(FALSE); |
| pDC- |
| } |
| pvPT = point; |
| CDialog::OnMouseMove(nFlags, point); |
| } |