怎样使得在移动一个窗口的时候呈现出虚线框? (编程实现)

program_cock 2006-08-15 08:57:00
怎样使得在移动一个窗口的时候,如果一直按住鼠标拖动的话,其在移动过程中只呈现出虚线框;只有当停止拖动,鼠标不再被按住的时候,窗口中的内容才会完全呈现出来?应该用哪些API?我用MoveWindow移动窗口的话,不会出现虚线框。请大虾指点!
...全文
344 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
dick_song 2006-08-15
  • 打赏
  • 举报
回复
在WM_LBUTTONDOWN事件中加入下面的代码:
ReleaseCapture();
SendMessage(hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0);
songlife33 2006-08-15
  • 打赏
  • 举报
回复
我看过一个列子,是模拟鼠标点击标题栏的消息,那样就和系统移动窗口的效果一个摸样,可惜例子在家里的机器上,不然发给你
化外之民 2006-08-15
  • 打赏
  • 举报
回复

class CRectTracker
Remarks
CRectTracker does not have a base class.

The CRectTracker class allows an item to be displayed, moved, and resized in different fashions. Although the CRectTracker class is designed to allow the user to interact with OLE items by using a graphical interface, its use is not restricted to OLE-enabled applications. It can be used anywhere such a user interface is required.

CRectTracker borders can be solid or dotted lines. The item can be given a hatched border or overlaid with a hatched pattern to indicate different states of the item. You can place eight resize handles on either the outside or the inside border of the item. (For an explanation of the resize handles, see GetHandleMask.) Finally, a CRectTracker allows you to change the orientation of an item during resizing.

To use CRectTracker, construct a CRectTracker object and specify which display states are initialized. You can then use this interface to give the user visual feedback on the current status of the OLE item associated with the CRectTracker object.

For more information on using CRectTracker, see the article Trackers.

Requirements
Header: afxext.h

program_cock 2006-08-15
  • 打赏
  • 举报
回复
UP
robin_yao 2006-08-15
  • 打赏
  • 举报
回复
UP
program_cock 2006-08-15
  • 打赏
  • 举报
回复
liushaoyi0704(【化外之民】) 所说的“橡皮筋”是什么动东?在下愚钝,恳请指点一二!
化外之民 2006-08-15
  • 打赏
  • 举报
回复
要自己用橡皮筋实现的。拖动的时候并不真正移动窗口,而是画一个矩形。
muroachanf 2006-08-15
  • 打赏
  • 举报
回复
spy++,看一下移动过程中它接收了哪些消息,然后:模拟模拟模拟就ok了.

15,976

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 界面
社区管理员
  • 界面
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧