Code : Tout sélectionner
Procedure DragAndDrop()
dropped.l = EventwParam()
num.l = DragQueryFile_(dropped, -1, "", 0)
For index = 0 To num - 1
size.l = DragQueryFile_(dropped, index, 0, 0)
filename.s = Space(size)
DragQueryFile_(dropped, index, filename, size + 1)
extension.s = LCase(GetExtensionPart(filename))
Debug filename
Debug extension
Debug "--------------"
Next
DragFinish_(dropped)
EndProcedure
If OpenWindow(0, 200, 200, 300, 300, #PB_Window_SystemMenu, "DnD")
DragAcceptFiles_(WindowID(), #TRUE)
Repeat
Select WaitWindowEvent()
Case #WM_CLOSE : End
Case #WM_DROPFILES : DragAndDrop()
EndSelect
ForEver
EndIf