EnableDragAndDrop
int EnableDragAndDrop (int panelHandle);
Purpose
This function enables traditional Windows file drag–and–drop notification for the specified panel. After you call this function, the panel's standard callback function will be passed an EVENT_FILESDROPPED event whenever files are dropped onto the panel from the Windows Explorer Shell.
When you receive the EVENT_FILESDROPPED event, you can call the GetDragAndDropData function to receive the data associated with the notification: the list of files dropped onto the panel and the position of the cursor when the files were dropped.
For backwards compatibility in 32-bit programs, LabWindows/CVI also passes the list of files as the eventData1 parameter and the cursor position as the eventData2 parameter of the panel callback function. In 64-bit programs, however, these parameters are 0.
![]() |
Note LabWindows/CVI passes the panel's ATTR_CALLBACK_DATA pointer to the panel callback with the EVENT_FILESDROPPED event. |
![]() |
Note Do not call this function for a LabWindows/CVI child panel—child panels respond to drag–and–drop notifications as long as their parent panels do. |
(Linux) This function is not supported.
Parameters
Input | ||
Name | Type | Description |
panelHandle | int | The handle of the LabWindows/CVI panel for which to enable drag–and–drop notification. |
Return Value
Name | Type | Description |
status | int | The status code that the function returns. 0 indicates success. A negative value indicates an error. This function may return a Programmer's Toolbox or UI Library error–code. Call GetGeneralErrorString to obtain a text description of the error. |
Additional Information
Library: Programmer's Toolbox
Include file: toolbox\toolbox.h
LabWindows/CVI compatibility: LabWindows/CVI 5.5 and later
Example
Refer to toolbox\msgdemo.cws for an example of using the EnableDragAndDrop function.