How to disable dropping of files in RichEdit 2.0

本文介绍如何通过调用RevokeDragDrop函数并重写WM_DROPFILES消息处理程序来禁用RichEdit 2.0控件中的文件拖放功能。此方法适用于使用CRichEditCtrl类的应用程序。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Summary:

 How do you disable the dropping of files in RichEdit version 2.0 with the CRichEditCtrl class?

Call the RevokeDragDrop(), passing the pointer to the RichEdit control window, as the parameter. Also, override the OnDropFiles() and return without calling the   function of the base class. 

 

More Information:

To prevent a Drag-and-Drop enabled window from accepting files use the RevokeDragDrop() function. Pass the pointer to the target window as the parameter for the function. The WM_DROPFILES message handler must be overriden and control must be returned from it, without calling the OnDropFiles() function of the base class.

You use this function during the initialization, typically, in the InitInstance() function of the window procedure. Handling the WM_DROPFILES message alone, or calling only the RevokeDragDrop() is not sufficient. To successfully prevent the links from being placed in the RichEdit control version 2.0, you must do both of the previously mentioned steps.

 

from:      http://support.microsoft.com/default.aspx?scid=kb;en-us;195421

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值