Microsoft KB Archive/86724

{|
 * width="100%"|

HOWTO: Use Drag-Drop in an Edit Control or a Combo Box

 * }

Q86724

-

The information in this article applies to:


 * Microsoft Windows Software Development Kit (SDK)
 * Microsoft Win32 Software Development Kit (SDK)

-

SUMMARY
In the Microsoft Windows environment, an application can register an edit control or a combo box as a drag-drop client through the DragAcceptFiles function. The application must also subclass the control to process the WM_DROPFILES message that Windows sends when the user drops a file.

MORE INFORMATION
The following seven steps demonstrate how to implement drag-drop in an edit control. The procedure to implement drag-drop in a combo box is identical.


 * 1) Add SHELL.LIB to the list of libraries required to build the file.
 * 2) Add the name of the subclass procedure (MyDragDropProc) to the EXPORTS section of the module definition (DEF) file.
 * 3) Include the SHELLAPI.H file in the application's source code.
 * 4) Declare the following procedure and variables:
 * 5) Add the following code to the initialization of the dialog box:
 * 6) Write a subclass window procedure for the edit control.
 * 7) After the completion of the dialog box procedure, free the edit control subclass procedure.

Additional query words: combobox

Keywords : kbComboBox kbCtrl _IK kbEditCtrl kbOSWinNT kbOSWin2000 kbSDKWin32 kbGrpDSUser kbOSWin

Issue type : kbhowto

Technology : kbWin32SDKSearch kbAudDeveloper kbSDKSearch kbWin32sSearch kbWinSDKSearch