Drag & Drop fails on Windows 10

Can someone else do what Juan said is the problem?

  • build on Mac with target Windows
  • use the built from Mac and run on Windows 10
  • confirm that the PDF can’t be dragged

I’m going to try to build another version on a different Mac.

Edit: second test from different mac running 10.13.6, build for Windows, runs correctly on Windows 10

I dont have a valid licence for 2019r3.1 or I’d test it. Are you sure its not working because this app’s security is User and not Administrator which is contrary to what was mentioned above?

I’m running 10.15.4

Yes. the security in Xojo is setup to Administrator, the user I’m using for login in an Administrator and I’ve even disabled UAC

I need to make some additional tests around this. Depending on what code I’m writing in the DropObject event, even compiling from windows is not allowing me to drag the file. Even in debugging mode, the DropObject event is not started.

I’m going to install previous versions of Xojo and make some tests. I’ll keep you informed about the results.

For Windows, if you need more than the built-in Drag & Drop support, you can check out MBS Xojo Win Plugin.

classes listed here: The plugin part MBS Xojo Win Plugin:WinDragDrop:

Where you can define a WindowsDropTargetMBS and control more what comes in.

PPD?

Don’t you talked about PDF ?

[quote=484388:@Emile Schwarz]PPD?

Don’t you talked about PDF ?[/quote]
I’m sorry this was a mistake. Yes I’m talking about PDF…

[quote=484366:@Christian Schmitz]For Windows, if you need more than the built-in Drag & Drop support, you can check out MBS Xojo Win Plugin .

classes listed here: The plugin part MBS Xojo Win Plugin :WinDragDrop:

Where you can define a WindowsDropTargetMBS and control more what comes in.[/quote]
I didn’t know it… I’ve them, so I’m going to try. Thanks Christian

Hi. I’d like to share the last tests I’ve made regarding this.

If I Use the MBS Xojo Win Plugin: WinDragDrop, the software runs OK (the drag & drop event works fine), but ONLY if the software runs outside “Program Files” directory (for example if I execute it from the desktop). I’ve also found, even from the desktop, if I compile it specifing in Xojo Security privileges “Administrator”, it doesn’t work. So the only way I’ve found for making it work is choosing “User” in the Xojo Security privileges, running the software from outside Program Files directory and executing it with Administrator privileges. If I choose this 3 elements, all works fine. If I change only one of them, the drop event is not executed. Tested in 3 different Windows 10 (Version 1909 OS Build 18363.778).

Of course, I’d like to execute the software inside Program Files, so I’ll continue making tests for finding how it’d be possible.

Thanks all.

Ok. Finally I’ve been able to find where is exactly the problem. The Xojo DropObject is working as well as MBS WinDragDrop BUT. The Administrator local Group in Windows 10, has not the property of “Program Files”. How the Drag & Drop event has to “copy” a folder item into this folder, Windows is asking you for accepting the copy (like when you copy a file manually), but you can’t answer to this OS event from runtime in Xojo.

The solution I’ve found is just take the ownership of the folder in witch I’m running the software (in the security properties of the folder). Then all is working fine.

Of course, this is solving the problem in my computer, but not in the computers of my customers. I’d like to know if you’ve any idea of how taking the ownership of a folder from Xojo or how to disable/answer in runtime the OS prompt for coping the file into Program Files.

I’ve just spent a few hours over the last two days getting to know the ins and outs of drag and drop with elevated apps, I now have drag and drop working from explorer to a xojo app with native xojo code. There’s a long discussion here, could you let me know the problem you have in steps you want to achieve?

Is is basically this?

If you elevate your app you should have access to Program Files.
You don’t want to elevate because drag and drop doesn’t work?