Jump to content
Sign in to follow this  

File list drag and drop

Recommended Posts


I want to introduce my decision of file list drag&drop problem.

Macro @Gui_DragFile consists only the last item in the dropped list,

so I create background control to handle drop event:

#include <GUIConstants.au3>

GUICreate('Drop Area', 400, 300, -1, -1, -1, $WS_EX_ACCEPTFILES)

; The control to receive information
; Y=-100 to hide text and HEIGHT+100 to cover whole the window

$drop = GUICtrlCreateInput('', 0, -100, 400, 400, $WS_DISABLED + $ES_AUTOHSCROLL, 0)

; Create other controls here


$msg = 0

while $msg <> $GUI_EVENT_CLOSE
  $msg = GUIGetMsg()
  if not $msg then
  elseif $msg = $GUI_EVENT_DROPPED then
    if @GUI_DRAGID = -1 then    ; File(s) dropped
      $files = GUICtrlRead($drop)  ; File list in the form: file1|file2|...

      MsgBox(0, 'Dropped', StringReplace($files, '|', @CR))

I hope it would be helpful.

Good luck!

Edited by reggy

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