Jump to content

Recommended Posts

Posted (edited)

I create a GUI (with WS_EX_ACCEPTFILES), create an Input control (and set state to GUI_DROPACCEPTED), and assign the GUI_EVENT_DROPPED event to a function. It works perfectly. (When I drag a file onto the Input control, the control is populated, and then my Dropped function is called.)

But if I change the Input control to an Edit control, the GUI_EVENT_DROPPED function is never called. (I can still drop a file on the Edit control, and it's populated, but the function that should then get called never is.)

#include <GUIConstants.au3>
Opt("GUIOnEventMode", 1)

GUICreate("Test", 320,260, @DesktopWidth/2-160, @DesktopHeight/2-45, $WS_OVERLAPPEDWINDOW, $WS_EX_ACCEPTFILES)

$filesCtrlID = GUICtrlCreateInput( "", 10,  5, 300, 200)
;If I change the above to GUICtrlCreateEdit, the FileWasDropped function is never called

GUICtrlSetState($filesCtrlID, $GUI_DROPACCEPTED)
GUISetOnEvent($GUI_EVENT_DROPPED, "FileWasDropped")
GUISetState (@SW_SHOW) 

While 1
   Sleep(1000)
Wend

Func FileWasDropped()  ;Only gets called for Input control, not for Edit control
   msgbox(4096, "dropped", "Dropped is called!")
EndFunc

Any ideas? Many thanks for any help!

(This is with AutoIt 3.2.0.1 on Windows XP SP2.)

Edited by ZoScr
Posted

I cannot remember why it was the only control type that cannot have an drop event.

But that the way it was implemented long time ago (beta 3.1.1.99). :">

Posted

I cannot remember why it was the only control type that cannot have an drop event.

But that the way it was implemented long time ago (beta 3.1.1.99). :">

maybe you could make it compatible with every guictrlcreate command ;)

Posted

maybe you could make it compatible with every guictrlcreate command ;)

I need to remember why I exclude the edit control only :"> :">
Posted

Thanks for the answer. In the interim, perhaps it could be added to the relevant pages of the user manual that this function doesn't work with this kind of control?

Posted

Thanks for the answer. In the interim, perhaps it could be added to the relevant pages of the user manual that this function doesn't work with this kind of control?

In fact I suppress the control to allow edit control to work in 3.2.1.13.

We will see if It was on purpose ;)

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
×
×
  • Create New...