Drag & drop multiple files?

BlitzMax Forums/MaxGUI Module/Drag & drop multiple files?

Casaber(Posted 2015) [#1]
Thereīs an example how to read a single drag and dropped file, but thereīs no clue how you handle multiple files at once. It seem so weird to just read events and guess based on timing if they belong together or not?

Isnīt there a proper way to get the number and names of all files dropped at once?


Kryzon(Posted 2015) [#2]
How comfortable would you be to tweak the MaxGUI module?

It separates into individual events by design:
			Case WM_DROPFILES
				Local hdrop,pt[2],path$
				Local pbuffer:Short[MAX_PATH]
				Local i,n,l
				DragQueryPoint wp,pt
				n=DragQueryFileW(wp,$ffffffff,Null,0);

				'For each file dragged, create a single event.

				For i=0 Until n
					l=DragQueryFileW(wp,i,pbuffer,MAX_PATH)
					path=String.FromShorts(pbuffer,l)
					PostGuiEvent EVENT_WINDOWACCEPT,0,0,pt[0],pt[1],path
				Next

				DragFinish wp

Taken from the Windows MaxGUI driver source: https://github.com/BlitzMaxModules/maxgui.mod/blob/master/win32maxguiex.mod/win32maxguiex.bmx#L1824

Figure out how you want it to behave, then make the modifications and rebuild the module.
A suggestion is to collect all the file paths that were dragged into a single EVENT_WINDOWACCEPT type event separated by some special character (like a null character) in the Extra field, then include the total number of file paths in the Data field of the event object.
EDIT: Or just include an array of String objects in the Extra field, that should be simpler (and you can query the amount of file paths with the array .length field).


Casaber(Posted 2015) [#3]
Oh, the big jump to try recompile, I tried to add mod once but Iīm not quiet there yet. Itīs all about knowing the
underlaying compilers how to install and what's needed (PATH etc on Windows for instance).
I was so happy when I got everything working back again, it took a complete reinstall of BlitzMAX.

I downloaded the ming in link in the latest Bmax Platform help guide and put it in C:.
But I donīt trust that one bit to work after that failed recompilation which destroyed BlitzMAX.

I really should try break that wall soon and I think Iīve installed MING right this time but Iīm not yet willing to
try my single working computer again. I want to feel more at home before mods and also modifying sources.
The actual coding and source modification will be no problem, but setting up and feeling secure with the tools
being in place and able rely on them is the tough bit.

But after seeing this, Iīm thinking, that perhaps Mark had some thought behind all this? Maybe handling files
one-at-a-.time conceptually in code IS the right more cleaner way? For the user, things will seemingly happen all
at once either way, no difference there? I need to think more about this.

Thanks for the input !