#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
$Form1 = GUICreate("文件拖放执行命令", 262, 86, -1, -1,-1,$WS_EX_ACCEPTFILES)
$Combo1 = GUICtrlCreateCombo("", 8, 8, 241, 25)
$dropzone = GUICtrlCreateLabel("", 8,8, 241, 25)
GUICtrlSetBkColor($dropzone, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetState($dropzone, $GUI_DISABLE)
GUICtrlSetState($dropzone, $GUI_DROPACCEPTED)
$Edit1 = GUICtrlCreateEdit("", 8, 48, 241, 57, BitOR($ES_READONLY,$ES_WANTRETURN), 0)
GUICtrlSetData(-1, "请拖放文件到上面combo")
GUISetOnEvent($GUI_EVENT_DROPPED, "GUI_Drop")
GUISetOnEvent($GUI_EVENT_CLOSE, "GUI_Exit")
GUISetState(@SW_SHOW)
While 1
Sleep(100)
WEnd
Func GUI_Exit()
Exit
EndFunc
func GUI_Drop()
$file=@GUI_DragFile&"|"
GUICtrlSetData($Combo1, $file,@GUI_DragFile)
$filesize=FileGetSize (GUICtrlread($Combo1))
GUICtrlSetData($Edit1,'文件大小:'&$filesize/1048576&' m')
EndFunc
|