;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; ;; AutoIt Version: 3.3.14.2 ;; ;; ;; ;; Template AutoIt script. ;; ;; ;; ;; AUTHOR: TheSaint ;; ;; ;; ;; SCRIPT FUNCTION: Program using a dropbox instead of the right-click open with menu ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; DropboxGUI(), RunWindow($action), GetProgramsFromRegistry(), SaveWindowLocation($window, $wintitle) #include #include #include #include #include #include #include #include _Singleton("folder-runner-thsaint") Global $action, $ans, $Dropbox, $folderpth, $inifle, $params, $path, $program, $programs, $setfle, $skipped, $updated Global $version, $window, $wintitle $inifle = @ScriptDir & "\Settings.ini" $setfle = @ScriptDir & "\Programs.ini" $updated = "(updated July 2023)" $version = "v1.0" DropboxGUI() Exit Func DropboxGUI() Local $Item_about, $Item_exit, $Item_file, $Item_fold, $Item_refresh, $Item_setup, $Label_drop, $Menu_drop ; Local $attrib, $fext, $left, $right, $target, $top ; $right = @DesktopWidth - 107 $left = IniRead($inifle, "Dropbox Window", "left", $right) $top = IniRead($inifle, "Dropbox Window", "top", 27) $Dropbox = GuiCreate("Dropbox", 82, 90, $left, $top, $WS_OVERLAPPED + $WS_CAPTION + $WS_SYSMENU + $WS_VISIBLE _ + $WS_CLIPSIBLINGS, $WS_EX_ACCEPTFILES + $WS_EX_TOPMOST + $WS_EX_TOOLWINDOW) ; $Label_drop = GUICtrlCreateLabel("", 0, 0, 80, 88, $SS_CENTER + $SS_NOTIFY) GUICtrlSetState($Label_drop, $GUI_DROPACCEPTED) GUICtrlSetFont($Label_drop, 8, 400) GUICtrlSetTip($Label_drop, "Drop a Folder Here!") ; ; CONTEXT MENU $Menu_drop = GUICtrlCreateContextMenu($Label_drop) $Item_refresh = GUICtrlCreateMenuItem("Refresh the List of Programs", $Menu_drop) GUICtrlCreateMenuItem("", $Menu_drop) $Item_setup = GUICtrlCreateMenuItem("Open the Run window", $Menu_drop) GUICtrlCreateMenuItem("", $Menu_drop) $Item_file = GUICtrlCreateMenuItem("View the Programs file", $Menu_drop) GUICtrlCreateMenuItem("", $Menu_drop) $Item_fold = GUICtrlCreateMenuItem("Open the program folder", $Menu_drop) GUICtrlCreateMenuItem("", $Menu_drop) $Item_about = GUICtrlCreateMenuItem("About", $Menu_drop) GUICtrlCreateMenuItem("", $Menu_drop) GUICtrlCreateMenuItem("", $Menu_drop) $Item_exit = GUICtrlCreateMenuItem("Exit the program", $Menu_drop) ; ; SETTINGS GUICtrlSetBkColor($Label_drop, $COLOR_LIME) $target = "Some" & @LF & "Right-Click" & @LF & "Options Are" & @LF & "Available" & @LF & "HERE" GUICtrlSetData($Label_drop, @LF & $target) Sleep(2000) GUICtrlSetBkColor($Label_drop, $CLR_DEFAULT) $target = "Drag && Drop " & @LF & "A Folder" & @LF & "HERE" & @LF & "(To Run With" & @LF & "A Program)" GUICtrlSetData($Label_drop, @LF & $target) ; $skipped = "" ; $programs = IniRead($inifle, "Folder Runner", "programs", "") If $programs = "" Then GetProgramsFromRegistry() EndIf GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Or $msg = $Item_exit ; Close the Dropbox SaveWindowLocation($Dropbox, "Dropbox") ; GUIDelete($Dropbox) ExitLoop Case $msg = $GUI_EVENT_DROPPED ; Folder added as new destination by drag and drop If @GUI_DragId = -1 Then If FileExists(@GUI_DragFile) Then $attrib = FileGetAttrib(@GUI_DragFile) If StringInStr($attrib, "D") > 0 Then $folderpth = @GUI_DragFile RunWindow("dropped") Else MsgBox(262192, "Drag Error", "Needs to be a folder not file.", 0, $Dropbox) EndIf Else MsgBox(262192, "Drag Error", "Drag & Drop path doesn't exist.", 0, $Dropbox) EndIf Else MsgBox(262192, "Drag Error", "Drag & Drop failed.", 0, $Dropbox) EndIf Case $msg = $Item_setup ; Open the Run window RunWindow("") Case $msg = $Item_refresh ; Refresh the List of Programs $ans = MsgBox(262144 + 33 + 256, "Skip Query", "Do you want to include skipped programs?", 0, $Dropbox) If $ans = 1 Then $skipped = 1 Else $skipped = "" EndIf GetProgramsFromRegistry() Case $msg = $Item_fold ; Open the program folder ShellExecute(@ScriptDir) Case $msg = $Item_file ; Open the Programs file If FileExists($setfle) Then ShellExecute($setfle) Case $msg = $Item_about ; About the program MsgBox(262208, "About The Program", _ "This is a program to assist with running a dragged and" & @LF & _ "dropped folder with a chosen specific listed program." & @LF & @LF & _ "Left-Click the Drag & Drop area to see the Run window." & @LF & @LF & _ "BIG THANKS to Jon & team at the AutoIt Forum." & @LF & @LF & _ "© July 2023 by TheSaint - Folder Runner " & $version & @LF & _ $updated, 0, $Dropbox) Case $msg = $Label_drop ; Open the Setup window GUISetState(@SW_HIDE, $Dropbox) RunWindow("") ; SaveWindowLocation($Dropbox, "Dropbox") ; GUIDelete($Dropbox) ExitLoop Case Else ;;; EndSelect WEnd EndFunc ;=> DropboxGUI Func RunWindow($action) Local $Button_cut, $Button_fold, $Button_info, $Button_new, $Button_quit, $Button_refresh, $Button_run, $Button_update, $Checkbox_run, $Group_programs Local $Input_name, $Input_params, $Input_path, $Label_name, $Label_params, $Label_path, $List_programs ; Local $autorun, $command, $commands, $e, $entries, $icoD, $icoI, $icoX, $ind, $left, $ProgramsGUI, $right, $shell, $skip, $style, $top, $user32 ; $right = @DesktopWidth - 445 $left = IniRead($inifle, "Programs Window", "left", $right) $top = IniRead($inifle, "Programs Window", "top", 27) $style = BitOR($WS_OVERLAPPED, $WS_CAPTION, $WS_SYSMENU, $WS_CLIPSIBLINGS, $WS_VISIBLE, $WS_MINIMIZEBOX) $ProgramsGUI = GuiCreate("Program Run Options", 420, 470, $left, $top, $style, $WS_EX_TOPMOST, $Dropbox) GUISetBkColor($COLOR_SKYBLUE, $ProgramsGUI) ; ; CONTROLS $Group_programs = GuiCtrlCreateGroup("Programs To Run With Folder", 10, 10, 400, 310) $List_programs = GUICtrlCreateList("", 20, 30, 380, 290) GUICtrlSetFont($List_programs, 11, 600) GUICtrlSetTip($List_programs, "Programs available for use with a drag & drop folder!") ; $Label_name = GUICtrlCreateLabel("Program Name", 10, 330, 95, 20, $SS_CENTER + $SS_CENTERIMAGE + $SS_SUNKEN) GUICtrlSetFont($Label_name, 7, 600, 0, "Small Fonts") GUICtrlSetBkColor($Label_name, $COLOR_GREEN) GUICtrlSetColor($Label_name, $COLOR_WHITE) $Input_name = GUICtrlCreateInput("", 105, 330, 187, 20) GUICtrlSetTip($Input_name, "Selected program name!") $Label_path = GUICtrlCreateLabel("Program Path", 10, 355, 90, 20, $SS_CENTER + $SS_CENTERIMAGE + $SS_SUNKEN) GUICtrlSetFont($Label_path, 7, 600, 0, "Small Fonts") GUICtrlSetBkColor($Label_path, $COLOR_BLUE) GUICtrlSetColor($Label_path, $COLOR_WHITE) $Input_path = GUICtrlCreateInput("", 100, 355, 310, 20) GUICtrlSetTip($Input_path, "Program path for selected file type!") $Label_params = GUICtrlCreateLabel("Parameters", 10, 380, 80, 20, $SS_CENTER + $SS_CENTERIMAGE + $SS_SUNKEN) GUICtrlSetFont($Label_params, 7, 600, 0, "Small Fonts") GUICtrlSetBkColor($Label_params, $COLOR_RED) GUICtrlSetColor($Label_params, $COLOR_WHITE) $Input_params = GUICtrlCreateInput("", 90, 380, 240, 20) GUICtrlSetTip($Input_params, "Parameters for selected program (if needed)!") ; $Checkbox_run = GUICtrlCreateCheckbox("Run On List Select", 302, 330, 110, 20) GUICtrlSetTip($Checkbox_run, "Run when list entry program is selected!") ; $Button_update = GuiCtrlCreateButton("UPDATE", 340, 379, 70, 22) GUICtrlSetFont($Button_update, 7, 600, 0, "Small Fonts") GUICtrlSetTip($Button_update, "Update the program values!") ; $Button_run = GuiCtrlCreateButton("TEST" & @LF & "RUN", 10, 410, 58, 50, $BS_MULTILINE) GUICtrlSetFont($Button_run, 9, 600) GUICtrlSetTip($Button_run, "Run Test the program and folder!") ; $Button_refresh = GuiCtrlCreateButton("REFRESH" & @LF & "THE LIST", 78, 410, 92, 50, $BS_MULTILINE) GUICtrlSetFont($Button_refresh, 9, 600) GUICtrlSetTip($Button_refresh, "Open the program folder!") ; $Button_new = GuiCtrlCreateButton("NEW", 180, 410, 50, 22) GUICtrlSetFont($Button_new, 7, 600, 0, "Small Fonts") GUICtrlSetTip($Button_new, "Create a new program entry!") ; $Button_cut = GuiCtrlCreateButton("CUT", 180, 438, 50, 22) GUICtrlSetFont($Button_cut, 7, 600, 0, "Small Fonts") GUICtrlSetTip($Button_cut, "Remove selected program entry!") ; $Button_fold = GuiCtrlCreateButton("D", 240, 410, 50, 50, $BS_ICON) GUICtrlSetTip($Button_fold, "Open the program folder!") ; $Button_info = GuiCtrlCreateButton("Info", 300, 410, 50, 50, $BS_ICON) GUICtrlSetTip($Button_info, "Viewer Information!") ; $Button_quit = GuiCtrlCreateButton("EXIT", 360, 410, 50, 50, $BS_ICON) GUICtrlSetTip($Button_quit, "Exit / Close / Quit the window!") ; ; OS SETTINGS $user32 = @SystemDir & "\user32.dll" $shell = @SystemDir & "\shell32.dll" $icoD = -4 $icoI = -5 $icoX = -4 ; ; SETTINGS GUICtrlSetImage($Button_fold, $shell, $icoD, 1) GUICtrlSetImage($Button_info, $user32, $icoI, 1) GUICtrlSetImage($Button_quit, $user32, $icoX, 1) ; If $action <> "dropped" Then GUICtrlSetState($Button_run, $GUI_DISABLE) EndIf ; $autorun = IniRead($inifle, "List Entry Selected", "auto_run", "") If $autorun = "" Then $autorun = 4 IniWrite($inifle, "List Entry Selected", "auto_run", $autorun) EndIf GUICtrlSetState($Checkbox_run, $autorun) ; If $programs <> "" Then $entries = StringSplit($programs, "|", 1) For $e = 2 To $entries[0] - 1 $program = $entries[$e] GUICtrlSetData($List_programs, $program) Next EndIf GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Or $msg = $Button_quit ; Close the Setup window SaveWindowLocation($ProgramsGUI, "Programs") ; GUIDelete($ProgramsGUI) ExitLoop Case $msg = $Button_update ; Update the program values $program = GUICtrlRead($Input_name) If $program <> "" Then If GUICtrlRead($Button_update) = "SAVE" Then If StringInStr($programs, "|" & $program & "|") < 1 Then $path = GUICtrlRead($Input_path) If FileExists($path) Then If $programs = "" Then $programs = "|" & $program & "|" Else $programs = $programs & $program & "|" EndIf IniWrite($inifle, "Folder Runner", "programs", $programs) ; IniWrite($setfle, $program, "program", $program) IniWrite($setfle, $program, "path", $path) $params = GUICtrlRead($Input_params) IniWrite($setfle, $program, "parameters", $params) GUICtrlSetState($Button_update, $GUI_DISABLE) GUICtrlSetState($Button_info, $GUI_DISABLE) GUICtrlSetState($Button_fold, $GUI_DISABLE) GUICtrlSetState($Button_quit, $GUI_DISABLE) _GUICtrlListBox_ResetContent($List_programs) $entries = StringSplit($programs, "|", 1) For $e = 2 To $entries[0] - 1 $program = $entries[$e] GUICtrlSetData($List_programs, $program) Next GUICtrlSetState($Button_update, $GUI_ENABLE) GUICtrlSetState($Button_info, $GUI_ENABLE) GUICtrlSetState($Button_fold, $GUI_ENABLE) GUICtrlSetState($Button_quit, $GUI_ENABLE) Else MsgBox(262192, "Save Error", "Program path does not exist.", 0, $ProgramsGUI) EndIf Else MsgBox(262192, "Update Error", "Program already exists on the list.", 0, $ProgramsGUI) EndIf ; GUICtrlSetData($Button_update, "UPDATE") If $action = "dropped" Then GUICtrlSetState($Button_run, $GUI_ENABLE) GUICtrlSetState($Button_refresh, $GUI_ENABLE) GUICtrlSetState($Button_new, $GUI_ENABLE) GUICtrlSetState($Button_cut, $GUI_ENABLE) GUICtrlSetState($Checkbox_run, $GUI_ENABLE) GUICtrlSetState($List_programs, $GUI_ENABLE) Else If StringInStr($programs, "|" & $program & "|") > 0 Then $path = GUICtrlRead($Input_path) If FileExists($path) Then IniWrite($setfle, $program, "path", $path) $params = GUICtrlRead($Input_params) IniWrite($setfle, $program, "parameters", $params) Else MsgBox(262192, "Update Error", "Program path does not exist.", 0, $ProgramsGUI) EndIf Else MsgBox(262192, "Update Error", "You cannot rename a program on the list.", 0, $ProgramsGUI) EndIf EndIf Else MsgBox(262192, "Update Error", "No program selected on list.", 0, $ProgramsGUI) EndIf Case $msg = $Button_run ; Run Test the program and folder If $action = "dropped" Then If FileExists($path) And FileExists($folderpth) Then If $params = "" Then $commands = '"' & $folderpth & '"' Else $commands = $params & ' "' & $folderpth & '"' EndIf If $autorun = 1 Then ShellExecute($path, $commands, "") EndIf EndIf EndIf Case $msg = $Button_refresh ; Refresh the list of programs GUICtrlSetState($Button_update, $GUI_DISABLE) If $action = "dropped" Then GUICtrlSetState($Button_run, $GUI_DISABLE) GUICtrlSetState($Button_refresh, $GUI_DISABLE) GUICtrlSetState($Button_new, $GUI_DISABLE) GUICtrlSetState($Button_quit, $GUI_DISABLE) GUICtrlSetState($Button_info, $GUI_DISABLE) GUICtrlSetState($Button_fold, $GUI_DISABLE) GUICtrlSetState($Button_cut, $GUI_DISABLE) GUICtrlSetState($Checkbox_run, $GUI_DISABLE) _GUICtrlListBox_ResetContent($List_programs) GetProgramsFromRegistry() If $programs <> "" Then $entries = StringSplit($programs, "|", 1) For $e = 2 To $entries[0] - 1 $program = $entries[$e] ;$progname = IniRead($setfle, $program, "program", "") GUICtrlSetData($List_programs, $program) Next EndIf GUICtrlSetState($Button_update, $GUI_ENABLE) If $action = "dropped" Then GUICtrlSetState($Button_run, $GUI_ENABLE) GUICtrlSetState($Button_refresh, $GUI_ENABLE) GUICtrlSetState($Button_new, $GUI_ENABLE) GUICtrlSetState($Button_quit, $GUI_ENABLE) GUICtrlSetState($Button_info, $GUI_ENABLE) GUICtrlSetState($Button_fold, $GUI_ENABLE) GUICtrlSetState($Button_cut, $GUI_ENABLE) GUICtrlSetState($Checkbox_run, $GUI_ENABLE) Case $msg = $Button_new ; Create a new program entry $program = "" GUICtrlSetData($Input_name, $program) $path = "" GUICtrlSetData($Input_path, $path) $params = "" GUICtrlSetData($Input_params, $params) GUICtrlSetData($Button_update, "SAVE") If $action = "dropped" Then GUICtrlSetState($Button_run, $GUI_DISABLE) GUICtrlSetState($Button_refresh, $GUI_DISABLE) GUICtrlSetState($Button_new, $GUI_DISABLE) GUICtrlSetState($Button_cut, $GUI_DISABLE) GUICtrlSetState($Checkbox_run, $GUI_DISABLE) GUICtrlSetState($List_programs, $GUI_DISABLE) Case $msg = $Button_info ; Setup Information MsgBox(262208, "About The Program", _ "This is a program to assist with running a dragged and" & @LF & _ "dropped folder with a chosen specific listed program." & @LF & @LF & _ "[Program Usage]" & @LF & _ "To save on mouse clicks, you can enable the checkbox" & @LF & _ "that will auto execute the clicked program with folder." & @LF & @LF & _ "You don't need to use the NEW button unless you want" & @LF & _ "to add another program entry not found in the Registry" & @LF & _ "for folders." & @LF & @LF & _ "The CUT button can be used to remove (delete) a listed" & @LF & _ "program entry." & @LF & @LF & _ "The UPDATE button can be used to add any changes" & @LF & _ "to program path or parameters or to save a new entry." & @LF & @LF & _ "REFRESH button can be used to recheck the Registry" & @LF & _ "for any new programs to use with folders or to update" & @LF & _ "existing program values or query previously skipped." & @LF & @LF & _ "If you want, you can use the TEST RUN button to run" & @LF & _ "the selected folder with the chosen program etc. No" & @LF & _ "window closure of this program occurs with this." & @LF & @LF & _ "Program window positions are remembered on exit." & @LF & @LF & _ "BIG THANKS to Jon & team at the AutoIt Forum." & @LF & @LF & _ "© July 2023 by TheSaint - Folder Runner " & $version & @LF & _ $updated, 0, $Dropbox) Case $msg = $Button_fold ; Open the program folder ShellExecute(@ScriptDir) Case $msg = $Button_cut ; Remove selected program entry $program = GUICtrlRead($List_programs) If $program <> "" Then $ind = _GUICtrlListBox_GetCurSel($List_programs) If _GUICtrlListBox_GetText($List_programs, $ind) = $program Then If StringInStr($programs, "|" & $program & "|") > 0 Then $ans = MsgBox(262144 + 33 + 256, "Removal Query", $program & @LF & @LF & "Are you sure you want to remove this program from the list?", 0, $Dropbox) If $ans = 1 Then $programs = StringReplace($programs, "|" & $program & "|", "|") IniWrite($inifle, "Folder Runner", "programs", $programs) IniDelete($setfle, $program) _GUICtrlListBox_DeleteString($List_programs, $ind) $ans = MsgBox(262144 + 33 + 256, "Skip Query", $program & @LF & @LF & "Do you want to skip this program in future?", 0, $Dropbox) If $ans = 1 Then $skip = 1 IniWrite($setfle, $program, "skip", $skip) EndIf $program = "" GUICtrlSetData($Input_name, $program) $path = "" GUICtrlSetData($Input_path, $path) $params = "" GUICtrlSetData($Input_params, $params) EndIf Else MsgBox(262192, "Remove Error", "Program name does not exist on list.", 0, $ProgramsGUI) EndIf Else MsgBox(262192, "Remove Error", "Program name mismatch, select again.", 0, $ProgramsGUI) EndIf Else MsgBox(262192, "Remove Error", "No program selected on list.", 0, $ProgramsGUI) EndIf Case $msg = $Checkbox_run ; Run when list entry program is selected If GUICtrlRead($Checkbox_run) = $GUI_CHECKED Then $autorun = 1 Else $autorun = 4 EndIf IniWrite($inifle, "List Entry Selected", "auto_run", $autorun) Case $msg = $List_programs ; Programs available for use with a drag & drop folder $program = GUICtrlRead($List_programs) GUICtrlSetData($Input_name, $program) $path = IniRead($setfle, $program, "path", "") GUICtrlSetData($Input_path, $path) $params = IniRead($setfle, $program, "parameters", "") GUICtrlSetData($Input_params, $params) ;IniRead($setfle, $progname, "source", $source) ; If $action = "dropped" Then If Not FileExists($path) Then $command = $path If StringInStr($command, " ") < 1 Then $path = @WindowsDir & "\" & $command If Not FileExists($path) Then $path = @SystemDir & "\" & $command EndIf EndIf EndIf If FileExists($path) And FileExists($folderpth) Then If $params = "" Then $commands = '"' & $folderpth & '"' Else $commands = $params & ' "' & $folderpth & '"' EndIf If $autorun = 1 Then SplashTextOn("", "Program Starting", 200, 120, Default, Default, 33) ShellExecute($path, $commands, "") SplashOff() ; SaveWindowLocation($ProgramsGUI, "Programs") ; GUIDelete($ProgramsGUI) ExitLoop EndIf EndIf EndIf Case Else ;;; EndSelect WEnd EndFunc ;=> RunWindow Func GetProgramsFromRegistry() Local $found, $keyname, $keyroot, $keytitle, $keyval, $num, $parts, $pos, $progkey, $progname, $skip, $source ; SplashTextOn("", "Checking Registry", 200, 120, Default, Default, 33) $keyroot = "HKEY_CLASSES_ROOT\Directory\shell" $num = 0 While 1 $num = $num + 1 $progname = RegEnumKey($keyroot, $num) If $progname = "" Then ExitLoop $progkey = "HKEY_CLASSES_ROOT\Directory\shell\" & $progname $keytitle = RegRead($progkey, "") $progkey = "HKEY_CLASSES_ROOT\Directory\shell\" & $progname & "\command" $keyval = RegRead($progkey, "") $path = StringSplit($keyval, '"', 1) $parts = $path[0] If $parts = 5 Then $source = StringStripWS($path[4], 7) $params = StringStripWS($path[3], 7) $path = StringStripWS($path[2], 7) ElseIf $parts = 3 Then $source = StringStripWS($path[2], 7) $params = StringStripWS($path[1], 7) $pos = StringInStr($params, " ") If $pos > 0 Then $path = StringLeft($params, $pos - 1) $params = StringMid($params, $pos + 1) Else $path = $params $params = "" EndIf Else ContinueLoop EndIf If StringInStr($keytitle, ".dll") > 0 Then $keytitle = "" If $keytitle = "" Then $keyname = $progname Else $keyname = $keytitle EndIf ; Get rid of any leading ampersand to a word. $keyname = StringReplace($keyname, " & ", "&&&") $keyname = StringReplace($keyname, " &", " ") $keyname = StringReplace($keyname, "&&&", " & ") ; $skip = IniRead($setfle, $keyname, "skip", "") If $skip = "" Or $skipped = 1 Then $found = IniRead($setfle, $keyname, "program", "") If $found = "" Then $ans = MsgBox(262144 + 35 + 256, "Programs Found", "Do you want to add this program?" & @LF _ & @LF & "Name = " & $keyname & @LF & "Path = " & $path & @LF & "Parameters = " & $params _ & @LF & "Source = " & $source, 0, $Dropbox) If $ans = 6 Then IniWrite($setfle, $keyname, "program", $progname) IniWrite($setfle, $keyname, "path", $path) IniWrite($setfle, $keyname, "parameters", $params) IniWrite($setfle, $keyname, "source", $source) ElseIf $ans = 7 Then If $skip = "" Then $ans = MsgBox(262144 + 33 + 256, "Skip Query", $keyname & @LF & @LF & "Do you want to skip this program in future?", 0, $Dropbox) If $ans = 1 Then $skip = 1 IniWrite($setfle, $keyname, "skip", $skip) ElseIf $ans = 2 Then $skip = 4 If $found <> "" Then IniDelete($setfle, $keyname) EndIf EndIf EndIf ElseIf $ans = 2 Then ExitLoop EndIf If $skip = "" Then If $programs = "" Then $programs = "|" & $keyname & "|" Else $programs = $programs & $keyname & "|" EndIf IniWrite($inifle, "Folder Runner", "programs", $programs) EndIf Else ; Update only, in case of change(s) IniWrite($setfle, $keyname, "path", $path) IniWrite($setfle, $keyname, "parameters", $params) IniWrite($setfle, $keyname, "source", $source) EndIf EndIf WEnd SplashOff() ;$keyroot = "HKEY_CLASSES_ROOT\folder\shell" EndFunc ;=> GetProgramsFromRegistry Func SaveWindowLocation($window, $wintitle) Local $left, $top, $winpos ; $winpos = WinGetPos($window, "") $left = $winpos[0] If $left < 0 Then $left = 2 ElseIf $left > @DesktopWidth - $winpos[2] Then $left = @DesktopWidth - $winpos[2] EndIf IniWrite($inifle, $wintitle & " Window", "left", $left) $top = $winpos[1] If $top < 0 Then $top = 2 ElseIf $top > @DesktopHeight - $winpos[3] Then $top = @DesktopHeight - $winpos[3] EndIf IniWrite($inifle, $wintitle & " Window", "top", $top) EndFunc ;=> SaveWindowLocation