Jump to content

Drag and drop location in GUI


Flax
 Share

Recommended Posts

  • Moderators

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

Quote

Do not create AutoIt-related topics here

 

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

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

 

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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...