Jump to content

Dragging not working with an Input box


Recommended Posts

What all is supposed to work with dragging files? I have used a list, but for a new program I'm making I was hoping it would work for a picture too. However now it's now even working for a Input box... Anybody have any ideas why?

#include <GUIConstants.au3>

Opt("GUIOnEventMode", 1)

GuiCreate('Testing Input - Accepting Files', 300, 30) 

    GuiSetOnEvent($GUI_EVENT_CLOSE, '_Exit')

GuiCtrlCreateInput('', 5, 5, 290, 20, -1, $WS_EX_ACCEPTFILES) 
    GuiCtrlSetState(-1, $GUI_DROPACCEPTED)
    GuiSetOnEvent($GUI_EVENT_DROPPED, '_Drop')

GuiSetState() 

While 1 
    Sleep(200)
WEnd

Func _Drop() 
    Msgbox(0, 'File Was Dropped', @GUI_DropID) 
EndFunc 

Func _Exit() 
    Exit 
EndFunc
Edited by Piano_Man
My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
Link to comment
Share on other sites

You have the $WS_EX_ACCEPTFILES in the wrong place

#include <GUIConstants.au3>

Opt("GUIOnEventMode", 1)

GUICreate('Testing Input - Accepting Files', 300, 30, -1, -1, -1, $WS_EX_ACCEPTFILES)

GUISetOnEvent($GUI_EVENT_CLOSE, '_Exit')

GUICtrlCreateInput('', 5, 5, 290, 20)
GUICtrlSetState(-1, $GUI_DROPACCEPTED)
GUISetOnEvent($GUI_EVENT_DROPPED, '_Drop')

GUISetState()

While 1
    Sleep(200)
WEnd

Func _Drop()
    MsgBox(0, 'File Was Dropped', @GUI_DropId)
EndFunc   ;==>_Drop

Func _Exit()
    Exit
EndFunc   ;==>_Exit

SciTE for AutoItDirections for Submitting Standard UDFs

 

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

 

Link to comment
Share on other sites

You have the $WS_EX_ACCEPTFILES in the wrong place

#include <GUIConstants.au3>

Opt("GUIOnEventMode", 1)

GUICreate('Testing Input - Accepting Files', 300, 30, -1, -1, -1, $WS_EX_ACCEPTFILES)

GUISetOnEvent($GUI_EVENT_CLOSE, '_Exit')

GUICtrlCreateInput('', 5, 5, 290, 20)
GUICtrlSetState(-1, $GUI_DROPACCEPTED)
GUISetOnEvent($GUI_EVENT_DROPPED, '_Drop')

GUISetState()

While 1
    Sleep(200)
WEnd

Func _Drop()
    MsgBox(0, 'File Was Dropped', @GUI_DropId)
EndFunc   ;==>_Drop

Func _Exit()
    Exit
EndFunc   ;==>_Exit
Sweet, that fixed it... Thanks!
My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
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...