IonicWind Software

Aurora Compiler => Tips and Tricks => Topic started by: sapero on May 07, 2009, 04:09:18 AM

Title: Drag&Drop in edit control
Post by: sapero on May 07, 2009, 04:09:18 AM
This example shows how to implement drag'n'drop in standard edit control.
First we need to subclass the control and call RegisterDragDrop in order to accept dropped text.
In the subclass function we just trap WM_DESTROY (cleanup) and WM_LBUTTONDOWN (drag-drop start). If there is selected text and the mouse is over it, call DragDetect api to check if the drag-drop was started. If DragDetect returns TRUE, call DoDragDrop to start.
Optional WM_MOUSEMOVE handler may change the cursor to arrow, if the mouse is over selected text.

To enable drag-drop in single edit control, call EnableDragDrop(handle, enable)