请教OnLButtonDown后,本进程就关不了了。
void CMeasureView::OnLButtonDown(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
CFormView::OnLButtonDown(nFlags, point);
if(MeasuringChoose==true&&point.x>0&&point.y>0&&point.y<m_Height&&point.x<m_Width)
{
switch(MeasureType)
{
case 2:
{
ChoosePoint1x=point.x;
ChoosePoint1y=576-point.y;
CPen *oldPen ;
CPen solidPen(PS_SOLID, 0,RGB(0,255,0));
CPen pianPen(PS_SOLID, 0,RGB(255,0,0));
CPen HengPen(PS_SOLID, 0,RGB(60,60,160));
CClientDC Dc(this);
CWnd* wnd;
wnd=GetDlgItem(IDC_STATIC_DISPLAY);
CRect rect;
wnd->GetClientRect(rect);
CDC *dc=NULL;
dc=wnd->GetDC();
oldPen = dc->SelectObject (&pianPen);
dc->MoveTo(point.x,point.y-3);
dc->LineTo(point.x,point.y+3);
dc->MoveTo(point.x+3,point.y);
dc->LineTo(point.x-3,point.y);
MeasuringChoose=false;
MeasureType=0;
ReleaseDC(dc);
break;
}
default:
{
break;
}
}
}
}
谢谢各位!
...全文
相关推荐
OnLButtonDown的响应问题
OnLButtonDown的响应问题
MFC获取picture控件的鼠标点击坐标位置的方法
MFC获取picture控件的鼠标点击坐标位置的方法
鼠标左键准确定位MFC基于对话框的滑块(进度条)控件
MFC中的滑块CSliderCtrl类不能准确定位到鼠标点击的位置,将MySlider.h和MySlider.cpp包含至项目中,用类MySlider来定义滑块变量,鼠标左键点击滑块时,滑块(进度条)能准确定位且不发生漂移。2014-11-12上传的存在的一个小问题是,当靠近滑块(进度条)的右端时不能准确定位,此处修正这个问题。
WM_NCLBUTTONDOWN.rar_CWnd_OnLButtonDown_WM_NCLBUTTONDOWN _postme
void TransparentWnd::OnLButtonDown(UINT nFlags, CPoint point) { CWnd::OnLButtonDown(nFlags, point) //实现无标题拖动 PostMessage(WM_NCLBUTTONDOWN, HTCAPTION, MAKELPARAM(point.x,point.y)) }
测试屏幕任意点的坐标.zip_MFC_instantwoo
mfc编写的小程序,测试屏幕任意点的坐标



