版权声明:本文为博主原创文章,未经博主允许不可以转载。 https://blog.csdn.net/aasmfox/article/details/80596380
在创建多个子控件时,如果选中了多个对象时,可以使用DrawFocus()这个函数来绘制当前的位置。
具体流程:
一、在OnLButtonDown(UINT nFlags, CPoint point) 事件中,保存这个Point原点
二、在OnMouseMove(UINT nFlags, CPoint point)事件中计算坐标偏移值 ,并绘制FocuseRect
三、在OnLButtonUp(UINT nFlags, CPoint point) 事件中,使用MoveWindow/setWindowpos调整位置,并刷新主界面.