Drag and drop file in windows 8.1 possible?

Just starting out? Need help? Post your questions and find answers here.
Sparkie
PureBatMan Forever
PureBatMan Forever
Posts: 2307
Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA

Re: Drag and drop file in windows 8.1 possible?

Post by Sparkie »

Fangbeast wrote:
Sparkie wrote:Fangles, are you able to drag/drop a text file from Win Explorer to Win Notepad?
...
I am trying to drop files from Windows 8.1 x64's file explorer onto a pb 5.21lts x86 window.
I get that part Fangles. I'm just trying to establish if it's a PB related issue or more of a Windows related issue. :wink:
I have the same setup as you with Windows 8.1 x64 and PB 5.21lts x86, and have no issues with drag/drop. :?
What goes around comes around.

PB 5.21 LTS (x86) - Windows 8.1
User avatar
Fangbeast
PureBasic Protozoa
PureBasic Protozoa
Posts: 4789
Joined: Fri Apr 25, 2003 3:08 pm
Location: Not Sydney!!! (Bad water, no goats)

Re: Drag and drop file in windows 8.1 possible?

Post by Fangbeast »

I get that part Fangles. I'm just trying to establish if it's a PB related issue or more of a Windows related issue. :wink:
I have the same setup as you with Windows 8.1 x64 and PB 5.21lts x86, and have no issues with drag/drop. :?
Oi!! None of that winking, my wife will have words with me!!!

I think I will just bash myself around the head with a big rock as 2 days of 41 degrees are coming up and I won't be able to think my way out of anything!
Amateur Radio/VK3HAF, (D-STAR/DMR and more), Arduino, ESP32, Coding, Crochet
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4946
Joined: Sun Apr 12, 2009 6:27 am

Re: Drag and drop file in windows 8.1 possible?

Post by RASHAD »

@Fangles :P
Take it easy
Try PB 5.11 x86 - x64 I think everything will go fine
Can not say more :)
Egypt my love
User avatar
Fangbeast
PureBasic Protozoa
PureBasic Protozoa
Posts: 4789
Joined: Fri Apr 25, 2003 3:08 pm
Location: Not Sydney!!! (Bad water, no goats)

Re: Drag and drop file in windows 8.1 possible?

Post by Fangbeast »

RASHAD wrote:@Fangles :P
Take it easy
Try PB 5.11 x86 - x64 I think everything will go fine
Can not say more :)
Okay, will do. Will report back if I am not a squishly pile of melted sludge!!!

*EDIT* Just tried 5.11x86, no difference. Used the example given to me blow, as simple as it gets. Wondering if my stoopid firewall/sandbox/antivurs comboo is the problem some how.

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
Amateur Radio/VK3HAF, (D-STAR/DMR and more), Arduino, ESP32, Coding, Crochet
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4946
Joined: Sun Apr 12, 2009 6:27 am

Re: Drag and drop file in windows 8.1 possible?

Post by RASHAD »

Try the next snippet with v5.21 & 5.11 and let me know the result
I wish the problem will be solved tonight for you to get some rest :)

Code: Select all

Procedure.s GetDropFile (*dropFiles, index)
  buffer = DragQueryFile_ (*dropFiles, index, 0, 0)
  For a = 1 To buffer: buffer$ + " ": Next
  DragQueryFile_ (*dropFiles, index, buffer$, buffer+1)
  ProcedureReturn buffer$
EndProcedure

#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)

 DragAcceptFiles_(GadgetID(#TargetFiles), 1)
 
Repeat
  Select WaitWindowEvent ()
    Case #WM_DROPFILES
        *dropped = EventwParam ()
        num = DragQueryFile_(*dropped , $FFFFFFFF, temp$, 0)
        f$ = ""
        For files = 0 To num - 1
          f$ + GetDropFile (*dropped, files) + Chr (13)
        Next
        AddGadgetItem(#TargetFiles,-1,f$)
        DragFinish_(*dropped)

    Case #PB_Event_CloseWindow
        Quit = 1
  EndSelect
Until Quit = 1
EndIf
End
Egypt my love
Sparkie
PureBatMan Forever
PureBatMan Forever
Posts: 2307
Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA

Re: Drag and drop file in windows 8.1 possible?

Post by Sparkie »

Fangbeast wrote:
I get that part Fangles. I'm just trying to establish if it's a PB related issue or more of a Windows related issue. :wink:
I have the same setup as you with Windows 8.1 x64 and PB 5.21lts x86, and have no issues with drag/drop. :?
Oi!! None of that winking, my wife will have words with me!!!

I think I will just bash myself around the head with a big rock as 2 days of 41 degrees are coming up and I won't be able to think my way out of anything!
I'm not seeing any answer to my original question my dear Fangles. Get out of the heat, pour some cold water over your big head and then tell me.....Can you drag/drop a .txt file from Explorer to Notepad? :mrgreen:
What goes around comes around.

PB 5.21 LTS (x86) - Windows 8.1
User avatar
Fangbeast
PureBasic Protozoa
PureBasic Protozoa
Posts: 4789
Joined: Fri Apr 25, 2003 3:08 pm
Location: Not Sydney!!! (Bad water, no goats)

Re: Drag and drop file in windows 8.1 possible?

Post by Fangbeast »

I'm not seeing any answer to my original question my dear Fangles.
Sorry, I got distracted by the past images of srod abusing those poor sheep again. It's not something your forget with time.
Get out of the heat, pour some cold water over your big head and then tell me
What's cold water??? It's 36 today, back to 41 tomorrow. Then next week might kill me:)
Can you drag/drop a .txt file from Explorer to Notepad?
Yes sir, that works well.
Amateur Radio/VK3HAF, (D-STAR/DMR and more), Arduino, ESP32, Coding, Crochet
User avatar
Fangbeast
PureBasic Protozoa
PureBasic Protozoa
Posts: 4789
Joined: Fri Apr 25, 2003 3:08 pm
Location: Not Sydney!!! (Bad water, no goats)

Re: Drag and drop file in windows 8.1 possible?

Post by Fangbeast »

[quote="RASHAD"]Try the next snippet with v5.21 & 5.11 and let me know the result
I wish the problem will be solved tonight for you to get some rest :)

Well, that was a shocker. Your example works fine in 5.21 RASHAD, the PB example from the help file doesn't. Haven't tried 5.11 yet.

Funny that the help example works in windows 7 x64 but not in windows 8.1 x4 On the same hardware. (I just swap installed hard drives and also use virtualbox images)

That means my firewall/sandbox/antivirus software isn't at fault or yours would fail to as it's the raw API version of PB drag and drop right?
Amateur Radio/VK3HAF, (D-STAR/DMR and more), Arduino, ESP32, Coding, Crochet
Sparkie
PureBatMan Forever
PureBatMan Forever
Posts: 2307
Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA

Re: Drag and drop file in windows 8.1 possible?

Post by Sparkie »

The questions are only going to get tougher from this point forward Fangles, so strap on your....ummmm......ahhhhhh.......oh nevermind, just hang in there best you can. :P

Maybe I missed it, but are you getting the proper drag/drop icon with no drop occurring or do you get the no drop icon (circle with diag line)?
What goes around comes around.

PB 5.21 LTS (x86) - Windows 8.1
Sparkie
PureBatMan Forever
PureBatMan Forever
Posts: 2307
Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA

Re: Drag and drop file in windows 8.1 possible?

Post by Sparkie »

Let's eliminate a few things:

Are you using PB IDE or JaPBe?
Are you compiling by pressing F5, or clicking the Compile icon?
Do you get same results if you create exe and run?

Now I know these may seem like silly questions, but I've had problems in the past (years ago) that were related to the above situations.
What goes around comes around.

PB 5.21 LTS (x86) - Windows 8.1
User avatar
Fangbeast
PureBasic Protozoa
PureBasic Protozoa
Posts: 4789
Joined: Fri Apr 25, 2003 3:08 pm
Location: Not Sydney!!! (Bad water, no goats)

Re: Drag and drop file in windows 8.1 possible?

Post by Fangbeast »

The questions are only going to get tougher from this point forward Fangles, so strap on your....ummmm......ahhhhhh.......oh nevermind, just hang in there best you can. :P
Tougher?? TOUGHER??? OOOOh Nooo, say it isn't so oh ferret infested master of mayhem!! And, I shall hang on to the urrrg, arrrm, ungha, ahem, thingamajigamabob!
Maybe I missed it, but are you getting the proper drag/drop icon with no drop occurring or do you get the no drop icon (circle with diag line)?
Circle with diag icon.
Amateur Radio/VK3HAF, (D-STAR/DMR and more), Arduino, ESP32, Coding, Crochet
User avatar
Fangbeast
PureBasic Protozoa
PureBasic Protozoa
Posts: 4789
Joined: Fri Apr 25, 2003 3:08 pm
Location: Not Sydney!!! (Bad water, no goats)

Re: Drag and drop file in windows 8.1 possible?

Post by Fangbeast »

Let's eliminate a few things:
Srod's festering underpants?
Are you using PB IDE or JaPBe?
PB IDE
Are you compiling by pressing F5, or clicking the Compile icon?
Compiling by pressing F5
Do you get same results if you create exe and run?
Never created an EXE before so just did it now and same result.
Now I know these may seem like silly questions, but I've had problems in the past (years ago) that were related to the above situations.
They are not silly questions Sir Sparkasaurus, master of the magical sheep roundabout, this is Microsoft's platform we are dealing with after all. What works on Windows 7 was almost guaranteed not to work the same (if at all!!) on windows 8 and up.

Every bit of drag and drop code that I have tried works fine on my windows 7 x32.

Oh, the inhumanity!
Amateur Radio/VK3HAF, (D-STAR/DMR and more), Arduino, ESP32, Coding, Crochet
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: Drag and drop file in windows 8.1 possible?

Post by srod »

Did I hear someone slating my festering underpants?

That's not fair; they don't belong to me anymore. They got up and scarpered, last seen loitering around the ISS trying to hitch a lift into the nether-regions of beyond.

Talk about escaping from the frying pan and heading into the fire huh! ;)
I may look like a mule, but I'm not a complete ass.
User avatar
Fangbeast
PureBasic Protozoa
PureBasic Protozoa
Posts: 4789
Joined: Fri Apr 25, 2003 3:08 pm
Location: Not Sydney!!! (Bad water, no goats)

Re: Drag and drop file in windows 8.1 possible?

Post by Fangbeast »

Did I hear someone slating my festering underpants?
Yes, the good quality stone slating stuff, not the cheap wooden ones. Although the festering does erode even the stone ones after a while.
That's not fair; they don't belong to me anymore.
Then why do I have an affidavit signed by you and witnessed by Jessica the dancing sheep? Ohh, you weren't quite awake and you could have signed anything at that point.
nether-regions of beyond.
Nether regions?? Oh, that image iss seared into my eyeballs now and I'll never sleep again! :shock: :shock: :shock:
Talk about escaping from the frying pan and heading into the fire huh! ;)
Well, when you are speaking about nether regions and then mention fire, I keep thinking about that last Indian curry we had. Never needed the gas stove as I recall, not after that :mrgreen: :mrgreen: :mrgreen: :mrgreen: :mrgreen: :mrgreen:
Amateur Radio/VK3HAF, (D-STAR/DMR and more), Arduino, ESP32, Coding, Crochet
LuCiFeR[SD]
666
666
Posts: 1033
Joined: Mon Sep 01, 2003 2:33 pm

Re: Drag and drop file in windows 8.1 possible?

Post by LuCiFeR[SD] »

Fangbeast wrote:Well, when you are speaking about nether regions and then mention fire, I keep thinking about that last Indian curry we had. Never needed the gas stove as I recall, not after that :mrgreen: :mrgreen: :mrgreen: :mrgreen: :mrgreen: :mrgreen:
make sure you put two toilet rolls in the fridge for morning then Fangles :twisted: :)
Post Reply