Page 1 of 1

Simulaty a file drag-and-drop into an app

Posted: 11 Dec 2020, 10:32
by madsounds
Is there a way to simulate drag-and-drop from AHK2 to an app? Or, more specifically, not drag-and-drop but just drop. I want to tell to a third-party window that there was a file dropped in it.

Re: Simulaty a file drag-and-drop into an app  Topic is solved

Posted: 11 Dec 2020, 10:55
by kczx3
I think you'd have to create a drag source and hopefully the target app is registered as a drop target...

Maybe this helps (though it is written in AHK v1) - https://github.com/AHK-just-me/DoDragDrop

Re: Simulaty a file drag-and-drop into an app

Posted: 11 Dec 2020, 12:25
by madsounds
Thanks, seems that it's what I'm looking for. I'll try to convert this to AHK2. Let's hope this won't take more than a year :-)

Re: Simulaty a file drag-and-drop into an app

Posted: 11 Dec 2020, 13:09
by kczx3
You’ll also have to program a way to actually put files on the clipboard. That’s a whole other thing...

EDIT: Looks like Lexikos wrote something for this a long while ago - https://autohotkey.com/board/topic/23162-how-to-copy-a-file-to-the-clipboard/?p=150209

Re: Simulaty a file drag-and-drop into an app

Posted: 11 Dec 2020, 16:20
by malcev
If application uses IDropTarget interface it will not be so easy
https://www.autohotkey.com/boards/viewtopic.php?f=6&t=56720