Drag files into ListView Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
john_c
Posts: 449
Joined: 05 May 2017, 13:19

Drag files into ListView

26 Aug 2019, 20:11

I have a simple script to drag files from the file manager into GUI. Currently it use Edit, but I want to use ListView instead. Is it possible? Any help and even general info (like "You can, but it will be very hard") is very appreciated.

Code: Select all

#SingleInstance, Force
Gui, Font,, Segoe UI
Gui, Add, Edit, w250 r5 vFiles, Drag your files here
Gui, +AlwaysOnTop -MinimizeBox +Owner
Gui, Show, Center
Return

GuiClose:
    ExitApp

GuiDropFiles:
    GuiControl,, Files

    Array := []
    Loop, Parse, A_GuiEvent, `n
        Array.Push(A_LoopField)

    String := ""
    For Index, Value In Array
        String .= "`n" . Value
    String := LTrim(String, "`n")

    GuiControl,, Files, % String
    Return

Code: Select all

Gui, Add, ListView, w250 r10, Name|Path
Gui, Show
Return

GuiClose:
    ExitApp
hd0202
Posts: 163
Joined: 04 Oct 2013, 03:07
Location: Germany near Cologne

Re: Drag files into ListView  Topic is solved

26 Aug 2019, 23:41

Code: Select all

#SingleInstance, Force
Gui, Font,, Segoe UI
Gui, Add, Edit, w250 r5 vFiles, Drag your files here
Gui, Add, ListView, w250 r10, Name|Path
Gui, +AlwaysOnTop -MinimizeBox +Owner
Gui, Show, Center
Return

GuiClose:
    ExitApp

GuiDropFiles:
    GuiControl,, Files

    Array := []
    Loop, Parse, A_GuiEvent, `n
        Array.Push(A_LoopField)

    String := ""
    For Index, Value In Array
	{
        String .= "`n" . Value
        splitpath, value, name, path
        LV_Add("", name, path)
	}
    String := LTrim(String, "`n")

    GuiControl,, Files, % String
    lv_modifycol()
    Return
Hubert
john_c
Posts: 449
Joined: 05 May 2017, 13:19

Re: Drag files into ListView

27 Aug 2019, 05:25

Thanks a lot, Hubert!

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot], Chunjee, Kolo, mikeyww, punchin, RubbeH and 48 guests