Jump to content

GUI_EVENT_DROPPED works for Input control, but not for Edit control


ZoScr
 Share

Recommended Posts

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

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 ;)

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...