GuiDropFiles and Microsoft Edge

Report problems with documented functionality
SpaghettiCoder
Posts: 6
Joined: 30 Sep 2015, 03:40

GuiDropFiles and Microsoft Edge

15 Nov 2018, 05:52

When drag&dropping an image out of Microsoft Edge, the file path is not transmitted correctly.

Example script:

Code: Select all

#Persistent
Gui +AlwaysOnTop
Gui, Show, W300 H100, DropFiles
Return

GuiClose:
ExitApp

GuiDropFiles:
MsgBox %A_GuiEvent%
Return
Example HTML file:

Code: Select all

<img src="./ahk-logo-no-text241x78-180.png">
When loading this file in Internet Explorer, dropping the image to the GUI works as expected: Full image file path is shown.

When loading this in Microsoft Edge, the path is incorrect:

1. When file is on local drive, file path is ill-formatted (leading slash, slashes instead of backslashes):
/C:/Temp/ahk-logo-no-text241x78-180.png
2. When file is on a remote share, server part is cut off, and ill-formatted (\\server\path\image.ext):
/path/image.ext
lexikos
Posts: 9583
Joined: 30 Sep 2013, 04:07
Contact:

Re: GuiDropFiles and Microsoft Edge

16 Nov 2018, 03:46

I was not aware that one could drag and drop an image from Internet Explorer onto a target that can only accept files. I confirmed that it does work, at least with a local file similar to yours.

When I drag the image from the same file in Edge, the GUI will not accept drop (Windows shows the red cross). It does the same thing if I drag over Explorer. Evidently, the version of Edge I have on Windows 10 v1809 does not provide a "dropfiles" data item.

AutoHotkey does not process the path in any way; it just calls a standard Win32 function which returns a string, and passes that string back to the script (when there are multiple paths, it joins the paths with `n but does nothing more). Whatever path you get is exactly whatever the source program provided.

In other words, this is a bug in your version of Edge.
SpaghettiCoder
Posts: 6
Joined: 30 Sep 2015, 03:40

Re: GuiDropFiles and Microsoft Edge

16 Nov 2018, 05:41

I was afraid you would say that.

It seems I will have to code my own drop handling, something like //autohotkey.com/board/topic/71966-urlg ... /?p=544366.

I wish AHK had an GuiDropText handler (which processes CF_UNICODETEXT), similar to GuiDropFiles. This would save me some work in getting the URL of the dropped object...

Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 43 guests