Aye, certainly works with a callback okay :
Code: Select all
Global gOldProc
;Subclasses the list icon gadget.
Procedure Callback(hWnd,uMsg,wParam,lParam)
Protected ReturnValue, numfiles, buffer$
Select uMsg
Case #WM_DROPFILES
*dropped = wParam
numfiles = DragQueryFile_(wParam , -1, 0, 0)
For i = 0 To numfiles - 1
buffer$=Space(DragQueryFile_(*dropped, i, 0, 0)+1)
DragQueryFile_ (*dropped, i, buffer$, Len(buffer$))
AddGadgetItem(1, -1, buffer$)
Next
DragFinish_(*dropped)
Default
ReturnValue = CallWindowProc_(gOldProc, hWnd, uMsg, wParam, lParam)
EndSelect
ProcedureReturn ReturnValue
EndProcedure
If OpenWindow(0, 0, 0, 300, 300, "Drag 'n' drop",#PB_Window_SystemMenu|#PB_Window_ScreenCentered) And CreateGadgetList(WindowID(0))
EditorGadget(1, 8, 8, 306, 133)
gOldProc = SetWindowLong_(GadgetID(1), #GWL_WNDPROC, @Callback())
DragAcceptFiles_(GadgetID(1), 1)
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
Quit = 1
EndSelect
Until Quit = 1
EndIf
End
Unsure why it shouldn't work with the PB drag/drop library, although if you add
to your code then the editor gadget at least exhibits the correct cursor when the drag is underway. Haven't tested the actual drop though.
I may look like a mule, but I'm not a complete ass.