Jump to content
Sign in to follow this  

How to drag file reference to another application?

Recommended Posts


Based on methods outlined in these forums, a ListView item can be dragged to another control ... and seems to be the easiest way to drag and drop content.  (Below is a working example.)

But I've run upon two problems:

1. The orange arrow points to a "bar" character that is appended to the file name when I drag to a control on the same window.  What is causing that?

2. Any other application window (even one of my own) rejects the drop of the ListView item (sounds a "ding").   Yet, my own (other) GUI can accept a file from a file manager, for example ... as can this example GUI.  What determines a window's "drag enabled" status? (i.e., as a source of files)

Thanks in advance to anyone who can point me to examples or explanations.

#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GuiListView.au3>

$hGUI = GUICreate("Move Input Anywhere Example", 400, 200, -1, -1, -1, $WS_EX_ACCEPTFILES)
$hInput = GUICtrlCreateInput("C:\Temp\RichNote.rtf", 10, 120, 320, 24)

$ListView = GUICtrlCreateListView("", 20, 20, 360, 80)
GUICtrlSetFont(-1, 11, 400, 0, "Tahoma")
_GUICtrlListView_AddColumn($ListView, "File Link:", 340)
GUICtrlCreateListViewItem("C:\Temp\RichNote.rtf", $ListView)


While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.