FrankSchneidewind Posted August 25, 2016 Posted August 25, 2016 Hi all, I got a quick question regarding Drag&Drop with GUIs. I made a little script that does something with files and I need a way to get the name/path of the file when I drag&drop it into the GUI. Is there a quick way to do this? Tyvm in advance! Neo
Moderators Melba23 Posted August 25, 2016 Moderators Posted August 25, 2016 FrankSchneidewind, How about this? M23 FrankSchneidewind 1 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
FrankSchneidewind Posted August 25, 2016 Author Posted August 25, 2016 1 hour ago, Melba23 said: FrankSchneidewind, How about this? M23 Thanks this helped alot. My form looks like this now: #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> ;#include <GUIConstants.au3> #include <ProgressConstants.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <FileConstants.au3> #include <File.au3> #include <INet.au3> #include <String.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("DVD Videosoft Updater", 306, 110, 390, 222) GUICtrlSetState(-1, $GUI_DROPACCEPTED) $status = GUICtrlCreateLabel("Nothing to do right now", 136, 8, 152, 17) GUICtrlSetState($status, $GUI_DROPACCEPTED) $useOwnINI = GUICtrlCreateCheckbox("Use own links.ini", 8, 8, 97, 17) GUICtrlSetState(-1, $GUI_DROPACCEPTED) $download_start = GUICtrlCreateButton("Download", 8, 32, 107, 25) GUICtrlSetState(-1, $GUI_DROPACCEPTED) $progressbar = GUICtrlCreateProgress(136, 32, 150, 25) GUICtrlSetState(-1, $GUI_DROPACCEPTED) $Label2 = GUICtrlCreateLabel("Drag && Drop!", 80, 80, 145, 17, $SS_CENTER) GUICtrlSetState(-1, $GUI_DROPACCEPTED) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $GUI_EVENT_DROPPED Global $droppedfile = @GUI_DragFile MsgBox(0,"",$droppedfile) EndSwitch WEnd I still can't drop files in there - the "no dop" mouse-icon appears every time i try to drop a file... Any idea what could be the reason for this? Thanks!
Moderators Melba23 Posted August 25, 2016 Moderators Posted August 25, 2016 FrankSchneidewind, Looks as if you forgot a vital style: $Form1 = GUICreate(... $WS_EX_ACCEPTFILES) M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
FrankSchneidewind Posted August 25, 2016 Author Posted August 25, 2016 (edited) 27 minutes ago, Melba23 said: FrankSchneidewind, Looks as if you forgot a vital style: $Form1 = GUICreate(... $WS_EX_ACCEPTFILES) M23 Still doesn't work and now the exit and minimize buttons are gone :/ Edited August 25, 2016 by FrankSchneidewind
Moderators Melba23 Posted August 25, 2016 Moderators Posted August 25, 2016 FrankSchneidewind, I bet you put it in the "normal style" rather than the "extended style" position - this is how it should look: $Form1 = GUICreate("DVD Videosoft Updater", 306, 110, 390, 222, Default, $WS_EX_ACCEPTFILES) M23 FrankSchneidewind 1 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
FrankSchneidewind Posted August 25, 2016 Author Posted August 25, 2016 1 hour ago, Melba23 said: FrankSchneidewind, I bet you put it in the "normal style" rather than the "extended style" position - this is how it should look: $Form1 = GUICreate("DVD Videosoft Updater", 306, 110, 390, 222, Default, $WS_EX_ACCEPTFILES) M23 Thanks, it's working now!
Moderators Melba23 Posted August 25, 2016 Moderators Posted August 25, 2016 FrankSchneidewind, Glad to hear it. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now