This way it will help you #include <GUIConstants.au3>
#include <StaticConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$BForm = GUICreate("Drop & Drag", 499, 95, -1, -1, -1, $WS_EX_ACCEPTFILES)
$Fpath = GUICtrlCreateInput("", 10, 28, 447, 25, 0)
GUICtrlSetState(-1, $GUI_DROPACCEPTED)
$LogPath = GUICtrlCreateButton("TEST", 460, 25, 35, 30, 0)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $LogPath
GUICtrlSetData($Fpath, FileOpenDialog("Choose File", "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}", "All file(*.*)", 1))
Case $GUI_EVENT_CLOSE
Exit
Case $GUI_EVENT_DROPPED
_Drop()
EndSwitch
WEnd
Func _Drop()
GUICtrlSetData($Fpath, @GUI_DragFile)
EndFunc ;==>_Drop
Setting the style to 0, will make your function get invoked
Regards