HOWTO: Disable Dropping of Files in Richedit 2.0

ID: Q195421


The information in this article applies to:


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.

Additional query words:


Keywords          : kbRichEdit kbGrpUser kbVS600 kbWinOS98 
Version           : WINDOWS:6.0
Platform          : WINDOWS 
Issue type        : kbhowto 

Last Reviewed: April 16, 1999