Drag and Drop in admin mode question
Posted: Fri Oct 07, 2022 10:12 pm
Hi there,
I am looking to be able to drag and drop a file from the Windows desktop onto a gadget and get the filename. The problem is that the program needs to be able to run in admin mode, but the drag and drop does not work in this case using PureBasic's inbuilt commands.
I saw that there was a discussion here regarding this, but the solution given makes the whole window the drop zone instead of a single gadget.
I've provided some example code below that I would like to be able to work in admin mode.
Kind regards,
Francis
I am looking to be able to drag and drop a file from the Windows desktop onto a gadget and get the filename. The problem is that the program needs to be able to run in admin mode, but the drag and drop does not work in this case using PureBasic's inbuilt commands.
I saw that there was a discussion here regarding this, but the solution given makes the whole window the drop zone instead of a single gadget.
I've provided some example code below that I would like to be able to work in admin mode.
Code: Select all
OpenWindow(0, 0, 0, 640, 480, "Drag and Drop Test Window", #PB_Window_ScreenCentered | #PB_Window_SystemMenu)
CreateImage(0, 600, 440, 32, #PB_Image_Transparent)
ImageGadget(0, 20, 20, 600, 440, ImageID(0), #PB_Image_Border)
EnableGadgetDrop(0, #PB_Drop_Files, #PB_Drag_Copy)
Repeat
Select WaitWindowEvent()
Case #PB_Event_GadgetDrop
Debug EventDropFiles()
Case #PB_Event_CloseWindow
ExitProgram = 1
EndSelect
Until ExitProgram = 1
Francis