Flax

Drag and drop location in GUI

4 posts in this topic

#1 ·  Posted

Hey, is there a way to get info where file was dropped in your GUI ? For example I have two info boxes and need to know if it was dropped in first or second box :)

 

Thx

Share this post


Link to post
Share on other sites



#2 ·  Posted

Moved to the appropriate forum, as the Dev forum states at the top

Quote

Do not create AutoIt-related topics here

 


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

#3 ·  Posted

Here is a simple solution for you. Note the - @GUI_DropId = $Input_0

; Script generated by GUIBuilder Prototype 0.9

#include <Constants.au3>
#include <GUIConstantsEx.au3>
#include <Misc.au3>
#include <WindowsConstants.au3>
#include <EditConstants.au3>

Const $style = BitOR($WS_OVERLAPPED, $WS_CAPTION, $WS_SYSMENU, $WS_VISIBLE, $WS_CLIPSIBLINGS, $WS_MINIMIZEBOX)

Global $h_main = GuiCreate("MyGUI", 400, 44, -1, -1, $style, $WS_EX_ACCEPTFILES)

Global $Input_0 = GuiCtrlCreateInput("", 10, 10, 380, 20)
GUICtrlSetState($Input_0, $GUI_DROPACCEPTED)


GuiSetState(@SW_SHOWNORMAL)

Do
    Switch GuiGetMsg()
         Case $GUI_EVENT_CLOSE
            ExitLoop
         Case $GUI_EVENT_DROPPED
            If @GUI_DropId = $Input_0 Then GUICtrlSetData($Input_0, @GUI_DragFile)
         Case Else
            ;
    EndSwitch
 Until False

 GUIDelete($h_main)

 Exit

 


AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Share this post


Link to post
Share on other sites

#4 ·  Posted

Thanks,  @GUI_DropId thats the one :)

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