Page 1 of 5

Drag and drop file in windows 8.1 possible?

Posted: Tue Jan 28, 2014 3:23 am
by Fangbeast
I have enabled my web gadget with

EnableGadgetDrop(#MyWebGadget, #PB_Drop_Files, #PB_Drag_Copy)

But when I check with

Case #PB_Event_GadgetDrop

The operation seems to be forbidden. Has the webgadget ever had that ability? Help doesn't mention it specifically but I was hoping.

**Update** Been trying various bits of drag and drop from my old codes and forum examples and right now, I can't get a single example working on Windows 8.1 x64. They used to work under windows 7 x86. Using PB 5.21LTS x86

No idea what's going on (as usual LOL)

Must see if I can get a virtual machine going.

**Update**

Just installed a windows 7 x86 virtual machine and the same code that DOESN'T WORK on windows 8.1 WORKS FINE in that virtual machine. As do all the drag and drop examples.

P.S. The file browser from the File menu in the IDE cannot see the LIBRARY link in Windows 8.1 but it can in Windows 7

Hmm. Anyone else test drag and drop in Windows 8.1 to verify this? Don't want to do a bug report unless it's warranted.

Re: Drag and drop file in windows 8.1 possible?

Posted: Tue Jan 28, 2014 8:53 am
by bembulak
Do you want me to just the Drag and Drop Example that ships with PB, or do you have a specific one?

Re: Drag and drop file in windows 8.1 possible?

Posted: Tue Jan 28, 2014 11:46 am
by luis
I I've tried to launch the executable of a program I wrote in PB that use drag and drop, and it seems to works well under win 8.1.

I've also tried the PB D&D demo from the help, and it works.

I didn't try anything involving the webgadget.

Re: Drag and drop file in windows 8.1 possible?

Posted: Tue Jan 28, 2014 11:52 am
by Fangbeast
bembulak wrote:Do you want me to just the Drag and Drop Example that ships with PB, or do you have a specific one?
Just try the standard one. It's windows 8.1 x64 that it fails on. Seems like a lot of things still don't work right on x64 bit windows for me and that's not just drag and drop in pb.

Now, 32 bit windows seem to be all right but I don't have a copy of 32 bit windows 8.1 to test to validate this claim.

Re: Drag and drop file in windows 8.1 possible?

Posted: Tue Jan 28, 2014 11:53 am
by Fangbeast
luis wrote:I I've tried to launch the executable of a program I wrote in PB that use drag and drop, and it seems to works well under win 8.1.

I've also tried the PB D&D demo from the help, and it works.

I didn't try anything involving the webgadget.

Is your version of windows 8.1 x86 or x64 like mine?

Windows 7 x86, PB 5.21LTS X86, drag and drop works for me.
Windows 8.1 x64, PB 5.21LTS X86, drag and drop doesn't work for me.

Re: Drag and drop file in windows 8.1 possible?

Posted: Tue Jan 28, 2014 12:01 pm
by luis
Fangbeast wrote: Is your version of windows 8.1 x86 or x64 like mine?
Win 8.1 x64, the exe was x64 (compiled with PB 5.20) and the demo from PB was tested on PB 5.21 x86 and x64.

Re: Drag and drop file in windows 8.1 possible?

Posted: Tue Jan 28, 2014 12:50 pm
by Fangbeast
luis wrote:
Fangbeast wrote: Is your version of windows 8.1 x86 or x64 like mine?
Win 8.1 x64, the exe was x64 (compiled with PB 5.20) and the demo from PB was tested on PB 5.21 x86 and x64.
Then I don't know what's going on.

In win 8.1 x64, my PB is 5.21LTS X86, run or compiled, no drag and drop. Comodo Security Suite active.

In win 7.0 x86, my PB is 5.21LTS X86, run or compiled, drag and drop. Comodo Security Suite active.

Would it be possible for a firewall to block this action (I am trying to imagine if this would be considered a 'threat' by such a software.)?

Going to whitelist the entire PureBasic directory as well as my development directory so see if that makes a difference, but I don't see how/why.

Re: Drag and drop file in windows 8.1 possible?

Posted: Tue Jan 28, 2014 1:02 pm
by Fangbeast
Okay, the drag and drop example from the PB manual works.

However,

I can still *NOT* drop files from windows 8.1 X64's explorer onto a PB program window.

I can drop files from windows 7.0 X86's explorer onto a PB program window.

getting closer.

Re: Drag and drop file in windows 8.1 possible?

Posted: Tue Jan 28, 2014 1:39 pm
by bembulak
Fangles wrote:I can still *NOT* drop files from windows 8.1 X64's explorer onto a PB program window.
Strange.

This is a stripped down version of the example that ships with PB. It works fine here, I can drop files from Windows Explorer and FreeCommander onto the list without any problems!

Code: Select all

EnableExplicit

#Window = 0

Enumeration    ; Gadgets
  #TargetFiles
EndEnumeration

Define Event, Count, i
Define Files$

If OpenWindow(#Window, 0, 0, 800, 600, "Drag & Drop", #PB_Window_SystemMenu|#PB_Window_ScreenCentered)
  ; Create the target gadgets 
  ListIconGadget(#TargetFiles, 5, 5, 7900, 590, "Drop Files here", 250)

  
  ; Now enable the dropping on the target gadgets
  EnableGadgetDrop(#TargetFiles,    #PB_Drop_Files,   #PB_Drag_Copy)
  
  Repeat
    Event = WaitWindowEvent()
       
    ; Drop event on the target gadgets, receive the dropped data
    ;
    If Event = #PB_Event_GadgetDrop
      Select EventGadget()
        Case #TargetFiles
          Files$ = EventDropFiles()
          Count  = CountString(Files$, Chr(10)) + 1
          For i = 1 To Count
            AddGadgetItem(#TargetFiles, -1, StringField(Files$, i, Chr(10)))
          Next i
      EndSelect
    
    EndIf
    
  Until Event = #PB_Event_CloseWindow
EndIf
End
OS: Windows 8.1 x64
PB: PureBasic 5.21 LTS (Windows - x64)

Re: Drag and drop file in windows 8.1 possible?

Posted: Tue Jan 28, 2014 1:46 pm
by ts-soft
Drag & Drop works only between programs with the same permission, like invoker, admin and so on. You should check that you use the right manifest and not a compatiblity-mode.

Re: Drag and drop file in windows 8.1 possible?

Posted: Tue Jan 28, 2014 9:03 pm
by Fangbeast
ts-soft wrote:Drag & Drop works only between programs with the same permission, like invoker, admin and so on. You should check that you use the right manifest and not a compatiblity-mode.
Didn't think about needing a manifest as this works in windows 7 without one. Just tested with a manifest in windows 8.1, no difference.

I feel Deja-Vu here, might have encountered this problem before but don't remember when.

Re: Drag and drop file in windows 8.1 possible?

Posted: Tue Jan 28, 2014 9:06 pm
by Fangbeast
bembulak wrote:
Fangles wrote:I can still *NOT* drop files from windows 8.1 X64's explorer onto a PB program window.
Strange.

This is a stripped down version of the example that ships with PB. It works fine here, I can drop files from Windows Explorer and FreeCommander onto the list without any problems!
This is driving me bonkers, not working here.

OS: Windows 8.1 x64
PB: PureBasic 5.21 LTS (Windows - x86)

Re: Drag and drop file in windows 8.1 possible?

Posted: Fri Jan 31, 2014 12:36 am
by em_uk
I have found that sometimes if you have ran PB as admin, drag and drop wont work from a users location.

Creating an exe then running under normal rights works fine. Hit and miss, I never complain about it just find a way round.

Re: Drag and drop file in windows 8.1 possible?

Posted: Fri Jan 31, 2014 3:27 am
by Sparkie
Fangles, are you able to drag/drop a text file from Win Explorer to Win Notepad?

Re: Drag and drop file in windows 8.1 possible?

Posted: Fri Jan 31, 2014 6:26 am
by Fangbeast
Sparkie wrote:Fangles, are you able to drag/drop a text file from Win Explorer to Win Notepad?
No oh great wizard!!!

I am trying to drop files from Windows 8.1 x64's file explorer onto a pb 5.21lts x86 window.

This worked on windows 7 x86 (never tried it with windows 7 x64).

Using the example from the pb help file, files don't drop in that either in win 8.1 x64 but it does work in win 7 x32.