The default implementation of drag-and-drop is sufficient for most applications, however, many applications require these standards to change the behavior of these standards. This article describes how to change these default steps. In addition, you can use this technique to build applications that do not support compliant documents as drop sources.
If you are customizing the OLE drag-and-drop behavior or if you already have a non-OLE application, you must create a COleDataSource object to contain the data. When the user starts a drag-and-drop operation, your code should call the DoDragDrop function in that object instead of in other classes that support drag-and-drop operations.
In addition, you can create a COleDropSource object to control the drop and overload many of its functions, increasing the dependency on the type of behavior you want to change. This drop source object is passed to the COleDataSource::D odragdrop To change the default behavior of these functions. These different options allow you to support drag-and-drop operations in your program with more flexibility. For more information about the data source, see the Objects and the number Sources (OLE).
You can overload the following function to customize the drag-and-drop operation:
Onbegindrag |
How to initialize a drag after you call DoDragDrop |
GiveFeedback |
Visual returns, such as different drag results, different cursors |
QueryContinueDrag |
Terminates the drag operation. This function allows you to detect the state of modifier keys during the drag process. |