Drag&Drop of multiple files under Windows ?

VA Smalltalk is a "100% VisualAge compatible" IDE that includes the original VisualAge technology and the popular VA Assist and WidgetKit add-ons.

Moderators: Eric Clayberg, wembley, tc, Diane Engles, solveig

Drag&Drop of multiple files under Windows ?

Postby marten » Mon May 28, 2007 3:54 am

This is a problem I've never managed to make it work - perhaps because I do not know very much about Windows API (and so on).

If I use native drag & drop I managed to drag & drop a single file (in the short file name specification), but I never managed to drag & drop multiple files from the Windows Explorer to a VASmalltalk application - I always only see the first file, but not the rest.

Can anyone give me a hint, how this can be done ?

Posts: 641
Joined: Sat Oct 14, 2006 7:10 am
Location: Hamburg - Germany

Postby Ralf » Tue May 29, 2007 8:42 am

Hello Marten,

I don't if Smalltalk can handle multiple files, but you can use the Window API, show WIN32 Help API for message WM_DROPFILES and the API function for you is probably "DragQueryFile" look there. This function gives informations how many file are dragged and this function returns the file name for specified dragged number of file. So you can iterate over all numbers and then require the file name for the actual number.

Perhaps this link http://www.codingcrew.de/programmierung/win32hlp.php is helpfully.

I hope this can help you.

Best regards

Here the discription for WM_DROPFILES the origin for drag and drop of files

The WM_DROPFILES message is sent when the user releases the left mouse button while the cursor is in the window of an application that has registered itself as a recipient of dropped files.

hDrop = (HANDLE) wParam; // handle of internal drop structure



Value of wParam. Identifies an internal structure describing the dropped files. This handle is used by the DragFinish, DragQueryFile, and DragQueryPoint functions to retrieve information about the dropped files.

Return Values

An application should return zero if it processes this message.

See Also

DragAcceptFiles, DragFinish, DragQueryFile, DragQueryPoint
Posts: 41
Joined: Thu Nov 16, 2006 4:18 am

Return to VA Smalltalk 7.0, 7.5 & 8.0

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest