Page 1 of 1

Drag & Drop Issue

Posted: Thu Sep 12, 2024 9:51 am
by PoorMan
Good Morning Everyone ...
Here is a 'Drag & Drope' Simple Code.
It works fine, however, if you check the option "Request Administrator mode for Windows Vista and above", then the Drag & Drop functionality will not
Any help will be much Appreciated.

Code: Select all

If OpenWindow(0, 0, 0, 300, 100, "Drop File Here", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  StringGadget(0, 10, 10, 300 -20, 30, "", #PB_String_ReadOnly)
  EnableGadgetDrop(0, #PB_Drop_Files, #PB_Drag_Copy)
  
  Repeat
    Select WaitWindowEvent()
      Case #PB_Event_GadgetDrop
        Select EventGadget()
          Case 0 ; gadgets that received a file/folder drag and drop event
            If Not FindString(EventDropFiles(), Chr(10))
              SetGadgetText(0, EventDropFiles())
            EndIf
          Case 1
            SetGadgetText(1, EventDropFiles())
        EndSelect
        
      Case #PB_Event_CloseWindow
        CloseWindow(0)
        End
    EndSelect
  ForEver
EndIf
Image

Re: Drag & Drop Issue

Posted: Thu Sep 12, 2024 1:08 pm
by HeX0R
You have to blame Windows, see e.g.:
https://superuser.com/questions/59051/d ... inistrator

Re: Drag & Drop Issue

Posted: Thu Sep 12, 2024 1:30 pm
by chi
Use the forums search: "drag drop admin", there are plenty of solved posts ;). But you have to use WinAPI...

Re: Drag & Drop Issue

Posted: Thu Sep 12, 2024 2:16 pm
by EaxVal
Hi,
I tested this on both environments and can tell that this issue appears in the x86 structure only!

Re: Drag & Drop Issue

Posted: Thu Sep 12, 2024 5:13 pm
by AZJIO