你试试这样;
UniExtract 也是这么做的
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("文件拖放测试", 262, 116, -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控件,其实是利用了窗口拖放,且只能工作于事件模式. PCBAR 08.07.09")
#EndRegion ### END Koda GUI section ###
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)
EndFunc
|