antiufo 0 Posted September 3, 2007 How can I create a GUI that: * Has no input controls * Accepts dropped files everywhere * when a file is dropped on any point of the window, call a function with the path of the file as parameter? thanks. Share this post Link to post Share on other sites
smashly 12 Posted September 3, 2007 Cover your GUI with a disabled transparent label and use the label to register the drop.eg:#include <GUIConstants.au3> $Gui = GUICreate("Drop 'N' ShellExecute", 300, 200, -1, -1, -1, $WS_EX_ACCEPTFILES + $WS_EX_TOPMOST) $CatchDrop = GUICtrlCreateLabel("", -1, -1, 300, 200) GUICtrlSetState(-1, $GUI_DISABLE + $GUI_DROPACCEPTED) GUISetState(@SW_SHOW, $Gui) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $GUI_EVENT_DROPPED If StringRight(@GUI_DRAGFILE, 4) = ExtFilter(StringRight(@GUI_DRAGFILE, 4)) Then ShellExecute(@GUI_DRAGFILE) EndIf EndSelect WEnd Func ExtFilter($iExt) $SSEXT = StringSplit(".exe|.jpg|.mp3|.txt", "|") For $i = 1 To $SSEXT[0] If $SSEXT[$i] = $iExt Then Return $iExt Next Return 0 EndFunc Cheers Share this post Link to post Share on other sites