Komawoyo Posted October 14, 2007 Posted October 14, 2007 is there a way to Let only certain file to be process when drag and dropping? Vb Scripts (*.vbs)
Nahuel Posted October 14, 2007 Posted October 14, 2007 I don't think there's a way of using filters, but you can do like this for example: #include <GUIConstants.au3> Opt("GuiOnEventMode",1) GUICreate("Form1", 200, 63, 229, 170, -1, BitOR($WS_EX_ACCEPTFILES,$WS_EX_WINDOWEDGE)) $Input1 = GUICtrlCreateInput("Drag and drop a file here", 12, 18, 177, 21) GUICtrlSetState(-1,$GUI_DROPACCEPTED) GUISetState(@SW_SHOW) GUISetOnEvent($GUI_EVENT_CLOSE,"_exit") GUISetOnEvent($GUI_EVENT_DROPPED,"_Dropped") While 1 Sleep(25) WEnd Func _exit() Exit EndFunc Func _Dropped() If StringRight(@GUI_DragFile,3)<>"vbs" Then GUICtrlSetData($Input1,"Invalid File Type!") Sleep(700) GUICtrlSetData($Input1,"Drag and drop a file here") EndIf EndFunc
Siao Posted October 14, 2007 Posted October 14, 2007 (edited) The above doesn't work if the control is Edit.Also @GUI_DRAGFILE doesn't support multiple files.Tho maybe this thing was fixed since v3.2.4.9 which I'm still using, I don't know.Anyway, you may also take a look at this, which doesn't suffer from the issues:#412438In any case, filtering must be done by you, like Nahuel said. Edited October 14, 2007 by Siao "be smart, drink your wine"
Nahuel Posted October 14, 2007 Posted October 14, 2007 Well yeah, it was just an example. What I meant is that he should do the filtering job.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now