Sign in to follow this  
Followers 0
vbMark

Drag and drop question

6 posts in this topic

Here is what I have so far...

#region --- GuiBuilder code Start ---
; Script generated by AutoBuilder 0.5 Prototype

#include <GuiConstants.au3>

GuiCreate("MyGUI", 280, 235,(@DesktopWidth-280)/2, (@DesktopHeight-235)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS + $WS_EX_ACCEPTFILES + $WS_EX_TOPMOST)

$Label_1 = GuiCtrlCreateLabel("Drop all files to be appended on to form.", 90, 90, 110, 40)

GUICtrlSetState ( $Label_1, $GUI_ACCEPTFILES )

GuiSetState()
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case Else
    ;;;
    EndSelect
WEnd
Exit
#endregion --- GuiBuilder generated code End ---

What event happens, or do I watch for, when the files are dropped on the form? I want to get the path to all the files dropped onto the form.

Thanks!

Share this post


Link to post
Share on other sites



I use a textbox to drag-and-drop in.

In the loop, you check if the textbox <> "", then StringSplit the contents to a variable. That array will contain all filenames. Afterwards you clear the contents again.

Share this post


Link to post
Share on other sites

I use a textbox to drag-and-drop in.

In the loop, you check if the textbox <> "", then StringSplit the contents to a variable. That array will contain all filenames. Afterwards you clear the contents again.

<{POST_SNAPBACK}>

That's cool. How do you get the items from the array?

Share this post


Link to post
Share on other sites

do something like:

$a_text = StringSplit(GuiCtrlRead($Input),"\")

for $i = 1 to $a_text[0]

MsgBox(0,"test",$a_text[$i]

next


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

do something like:

$a_text = StringSplit(GuiCtrlRead($Input),"\")

for $i = 1 to $a_text[0]

  MsgBox(0,"test",$a_text[$i]

next

<{POST_SNAPBACK}>

Worked great. Thanks.

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  
Followers 0