ahmeddzcom Posted September 24, 2015 Posted September 24, 2015 (edited) HelloThis Func Drag File and Drop :#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Func Drag File and Drop", 256, 53, -1, -1,-1, $WS_EX_ACCEPTFILES) $Input1 = GUICtrlCreateInput("[ ... ]", 8, 24, 241, 21) GUICtrlSetState(-1, $GUI_DROPACCEPTED) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEndi Need When Drop File Do Something Like Copy Or Rename This File.Tnx. Edited September 24, 2015 by ahmeddzcom
Bester Posted September 24, 2015 Posted September 24, 2015 (edited) Well your drag and drop works, do you want to rename or copy selected file?Here is some starting point for you:expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Global $gui_choose Global $btn_copy = 9999 Global $btn_rename = 9999 Global $Form1 = GUICreate("Func Drag File and Drop", 256, 53, -1, -1, -1, $WS_EX_ACCEPTFILES) Global $Input1 = GUICtrlCreateInput("[ ... ]", 8, 24, 241, 21) GUICtrlSetState(-1, $GUI_DROPACCEPTED) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Input1 WhatNext() Case $btn_copy CopyFile() Case $btn_rename RenameFile() EndSwitch WEnd Func WhatNext() ;Create new GUI to select the next action $gui_choose = GUICreate("What to do?", 200, 60, -1, -1, -1, $WS_EX_TOPMOST) $btn_copy = GUICtrlCreateButton("Copy", 10, 10, 80, 40) $btn_rename = GUICtrlCreateButton("Rename", 100, 10, 80, 40) GUISetState() EndFunc ;==>WhatNext Func CopyFile() ;<<<<<<<=========== Edit this anyway you want GUIDelete($gui_choose) MsgBox(0, "", "Create function for copying the file somewhere") EndFunc ;==>CopyFile Func RenameFile() ;<<<<<<<=========== Edit this anyway you want GUIDelete($gui_choose) MsgBox(0, "", "Create function for renaming the file") EndFunc ;==>RenameFile Edited September 24, 2015 by Bester ahmeddzcom 1
mikell Posted September 24, 2015 Posted September 24, 2015 #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Func Drag File and Drop", 456, 53, -1, -1,-1, $WS_EX_ACCEPTFILES) $Input1 = GUICtrlCreateInput("[ ... ]", 8, 24, 441, 21) GUICtrlSetState(-1, $GUI_DROPACCEPTED) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $GUI_EVENT_DROPPED Msgbox(0,"", @GUI_DragFile) ; do here whatever you want: GuiCtrlSetData($Input1, @GUI_DragFile & ".renamed") EndSwitch WEnd ahmeddzcom 1
ahmeddzcom Posted September 24, 2015 Author Posted September 24, 2015 Msgbox(0,"", @GUI_DragFile) ; do here whatever you want: GuiCtrlSetData($Input1, @GUI_DragFile & ".renamed")Yea ... iT iS ThisTnx Mikell
ahmeddzcom Posted September 24, 2015 Author Posted September 24, 2015 Tnx BesterWell your drag and drop works, do you want to rename or copy selected file?Here is some starting point for you:
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