LIBRARY rexxgui
DO
FUNCDEF("DragAcceptFiles", ", void, 32u", "shell32")
FUNCDEF("DragQueryCount", "32u, void, 32, void, void", "shell32", "DragQueryFile")
FUNCDEF("DragQueryFile", "32u, void, 32u, str[260] stor, 32u", "shell32")
CATCH FAILURE
CONDITION("M")
RETURN
END
guierr = "SYNTAX"
guiheading = 1
guicreatewindow('NORMAL')
again:
DO FOREVER
guigetmsg()
CATCH SYNTAX
CONDITION('M')
SIGNAL again
CATCH HALT
FINALLY
guidestroywindow()
END
RETURN
wm_dropfiles:
count = dragquerycount(ARG(1), -1)
IF ARG(2) == guiwindow THEN DO
guisay("There were" count "icons dropped on this window.")
variable = ""
END
ELSE DO
variable = guiinfo("VARIABLE", ARG(2))
guisay("There were" count "icons dropped on" variable || ".")
guisendmsg("MyList", "RESETCONTENT")
END
DO i = 1 TO count
dragqueryfile(ARG(1), i - 1, filename, 260)
IF variable \== "" THEN guisendmsg("MyList", "ADDSTRING", , filename)
END
RETURN "" |