Jump to content

Explorer / File Opener


DaLiMan
 Share

Recommended Posts

Edit 22-08-2006: - Version 1.0.3.3

Added - Startup with Windows

Added - Progress meter after item selection

Fixed - Little bug with .exe files

Edit 13-04-2006: - Version 1.0.3.0

Changed - Script code altered and reduced by half. (By Danny35d)

Added - Auto Minimize to tray after clicking a button YES/NO (Idea from billmez)

Edit 07-04-2006: - Version 1.0.2.4

Added - Open Windows Explorer maximized YES/NO

Edit 06-04-2006: ZIP file now includes the EXE.

Since I'm often opening and closing Windows Explorer and clicking towards the right folder / file,

I created this little program for the most frequently used links.

Just copy and paste the link of the folder or file you often use and press the button next to it.

You also have the ability to change the Tab names if you like to cluster some of your links.

When minimized the program goes to the tray. Double clicking or hitting CTRL-SHIFT-F3 will open the program again.

Anyway, it's not a high-tech piece of programming but it might be very usefull. (it is for me ... :) )

-- Needs AutoIt BETA or V3.2.0.1 --

ExplorerOpener_1030.zip

ExplorerOpener_1033.zip

Edited by DaLiMan
Link to comment
Share on other sites

I like the idea,

Very nice, I am also constantly going to different folders on my 3 hard drives but I found a different solution, at least for Windows XP.

Create a folder on your computer like in your My Documents and call it "Folders" or "Shortcuts". in that folder create shortcuts to all of your most commonly used directories.

Right click on your start bar, click Tool Bars, Click on New Toolbar..., Select that folder you just created, Click OK, then Bam, you now have a new item on your start bar with all the shortcuts. I compress it down so All I see is "Folders>>"

I have 3 of these custom toolbars on my start bar. I use one of them almost like a custom start menu.

Mike

Link to comment
Share on other sites

Anyway, it's not a high-tech piece of programming but it might be very usefull. (it is for me ... :think: )

Handy item and good idea. While @MikeOsdx's idea is also a good way to solve the problem, it just isn't AutoIt :(

I prefer to not open explorer full screen, but that is just me.

Thanks for sharing your idea and code.

Link to comment
Share on other sites

Since I'm often opening and closing Windows Explorer and clicking towards the right folder / file,

I created this little program for the most frequently used links.

Thank you for this code, i think it' s a good starting point of what i would like to do. I'm planning to do a locked launch menu (kiosk mode) to use with our web puplishing application server.

So can i start from your code ?

Link to comment
Share on other sites

Thank you for this code, i think it' s a good starting point of what i would like to do. I'm planning to do a locked launch menu (kiosk mode) to use with our web puplishing application server.

So can i start from your code ?

Hi Jango,

However I don't really understand what you want do to... :think: ... You sure can use my code!! :(

Link to comment
Share on other sites

Hi Jango,

However I don't really understand what you want do to... :think: ... You sure can use my code!! :(

Ok thank you, i would like to do a quick launch menu. I read in the registry a list of applications then i put a shortcut to these applications on a menu (like yours)... Then the users can only launch their apps and nothing else.

This menu is then published with THIS

Link to comment
Share on other sites

Ok thank you, i would like to do a quick launch menu. I read in the registry a list of applications then i put a shortcut to these applications on a menu (like yours)... Then the users can only launch their apps and nothing else.

This menu is then published with THIS

That's a nice option......

Good luck! :think:

Link to comment
Share on other sites

Edit 07-04-2006: - Version 1.0.2.4

Added - Open Windows Explorer maximized YES/NO

@billmez

Specially for you...... :think:

Thanks @DaLiMan, you are a gentleman and a scholar :(

One thing I really like about your solution rather than the "shortcut to shortcuts" from @MikeOsdx, is I will normally be working in 4-6 development directories at any given time. But they frequently change and it is very easy to make those adjustments in your script.

Link to comment
Share on other sites

I will normally be working in 4-6 development directories at any given time. But they frequently change and it is very easy to make those adjustments in your script.

Well, that's EXACTLY why I made it! Easy on-the-fly shortcut usage.
Link to comment
Share on other sites

Well, that's EXACTLY why I made it! Easy on-the-fly shortcut usage.

If anyone is interested, I modded the code a bit. Removed full screen explorer (before you added the option

@DaLiMan), resized the gui a bit smaller to fit my working environment better, and added minimize to tray after opening a folder, since I rarely open more than one at a clip.

I do have one question @DaLiMan, what exactly does the _ReduceMemory function do?

#include <GuiConstants.au3>
; ====================================================================================================

====================
; Title                 : My Explorer opener ©
; ====================================================================================================

====================
;
; AutoIt Version        : v3.1.1.117 (beta) or higher
; Platform            : WinNT/XP
; Author                : DaLiman
;
; Script Function       : Opening the frequent used folders or files.
;                         When the program is minimized you can use a keyboard shortcut to activate it. [ CTRL-SHIFT-F3 ]
;                         
;                         Tested with the most common files like office etc....
; Mods: billmez, smaller size, does not open explorer full screen, minimize on folder open
;=================================================Compiler opties==========================================================
#Region Compiler directives section
#Compiler_Prompt = n
#Compiler_Icon = folder_yellow.ico
#Compiler_Compression = 2
#Compiler_Allow_Decompile = y
#Compiler_Res_Description = My Explorer opener ©
#Compiler_Res_Field1Name = Auteur
#Compiler_Res_Field1Value = DaLiMan
#Compiler_Run_AU3Check = y
#Compiler_Run_After = "CopyMyExplorer-to-Output.exe"
#Compiler_Res_Fileversion = 1.0.2.3
#EndRegion
;===============================================Huidige Versie stand========================================================
Global $Versie = FileGetVersion(@ScriptFullPath)
Global $Name = "Explorer Opener ©"

;FileInstall("P:\ProgsToRun\AutoIt\AutoIt-scripts\ExplorerOpener\ExtraFiles\Tab.ini", @ScriptDir & "\tab.ini", 0)
; Div.Var's
Global $var0, $var0_1, $var1, $var2, $var3, $var4
Global $Input1_1, $Input1_2, $Input1_3, $Input1_4, $Input1_5, $Input1_6, $Input1_7, $Input1_8, $Input1_9, $Input1_10
Global $Input2_1, $Input2_2, $Input2_3, $Input2_4, $Input2_5, $Input2_6, $Input2_7, $Input2_8, $Input2_9, $Input2_10
Global $Input3_1, $Input3_2, $Input3_3, $Input3_4, $Input3_5, $Input3_6, $Input3_7, $Input3_8, $Input3_9, $Input3_10
Global $Input4_1, $Input4_2, $Input4_3, $Input4_4, $Input4_5, $Input4_6, $Input4_7, $Input4_8, $Input4_9, $Input4_10
Global $WindowWidth = 565
Global $WindowHeight = 245
Global $ShutDown = 0
Global $Bkgrnd = 0xECE9D8
; Optie settings
HotKeySet("^+{F3}", "_ResetWindow")
AutoItSetOption("GUICloseOnESC", "0")
AutoItSetOption("WinTitleMatchMode", 2)
opt("TrayAutoPause", 0)
opt("TrayIconDebug", 0)
opt("TrayMenuMode", 1)
; Tray settings
Global Const $TRAY_DEFAULT = 512
$TrayName = TrayCreateItem($Name)
TrayCreateItem("")
$TrayRestWindow = TrayCreateItem("Open Window")
TrayItemSetState(-1, $TRAY_DEFAULT)
$TrayExit = TrayCreateItem("Exit")
TraySetClick(16)


$MyGUI = GUICreate($Name & " - v." & $Versie, $WindowWidth, $WindowHeight, (@DesktopWidth - 703) / 2, (@DesktopHeight - 285) / 2)
GUISetBkColor($Bkgrnd)

$BRename1 = GUICtrlCreateButton("Tabs", 440, 0, 50, 20)
GUICtrlSetFont(-1, 7)
$BSave1 = GUICtrlCreateButton("Save", 495, 0, 50, 20)
GUICtrlSetFont(-1, 7)

$ChkTabShow = GUICtrlCreateCheckbox("Remember Last Shown Tab" , 30, $WindowHeight - 16, 150,12)
GUICtrlSetFont(-1, 7)
GUICtrlSetBkColor(-1,$Bkgrnd)

$Label1 = GUICtrlCreateLabel("When minimized use CTRL-SHIFT-F3 to activate!", $WindowWidth - 230,$WindowHeight - 16,210,12)
GUICtrlSetFont(-1, 7)
GUICtrlSetState(-1, $GUI_DISABLE)
;~ GUICtrlSetBkColor(-1,0x00ff00)

$tab = GUICtrlCreateTab(0, 0, $WindowWidth, $WindowHeight, BitOR($TCS_BUTTONS, $TCS_FIXEDWIDTH, $TCS_FLATBUTTONS))

; === TAB item 1 ===
$tab_1 = GUICtrlCreateTabItem("#1#")
$Input1_1 = GUICtrlCreateInput("C:\", 20, 25, 445, 20)
$Input1_2 = GUICtrlCreateInput("< input folder >", 20, 45, 445, 20)
$Input1_3 = GUICtrlCreateInput("< input folder >", 20, 65, 445, 20)
$Input1_4 = GUICtrlCreateInput("< input folder >", 20, 85, 445, 20)
$Input1_5 = GUICtrlCreateInput("< input folder >", 20, 105, 445, 20)
$Input1_6 = GUICtrlCreateInput("< input folder >", 20, 125, 445, 20)
$Input1_7 = GUICtrlCreateInput("< input folder >", 20, 145, 445, 20)
$Input1_8 = GUICtrlCreateInput("< input folder >", 20, 165, 445, 20)
$Input1_9 = GUICtrlCreateInput("< input folder >", 20, 185, 445, 20)
$Input1_10 = GUICtrlCreateInput("< input folder >", 20, 205, 445, 20)

$Button1_1 = GUICtrlCreateButton("Open / Run", 470, 25, 80, 20)
$Button1_2 = GUICtrlCreateButton("Open / Run", 470, 45, 80, 20)
$Button1_3 = GUICtrlCreateButton("Open / Run", 470, 65, 80, 20)
$Button1_4 = GUICtrlCreateButton("Open / Run", 470, 85, 80, 20)
$Button1_5 = GUICtrlCreateButton("Open / Run", 470, 105, 80, 20)
$Button1_6 = GUICtrlCreateButton("Open / Run", 470, 125, 80, 20)
$Button1_7 = GUICtrlCreateButton("Open / Run", 470, 145, 80, 20)
$Button1_8 = GUICtrlCreateButton("Open / Run", 470, 165, 80, 20)
$Button1_9 = GUICtrlCreateButton("Open / Run", 470, 185, 80, 20)
$Button1_10 = GUICtrlCreateButton("Open / Run", 470, 205, 80, 20)

; === TAB item 2 ===
$tab_2 = GUICtrlCreateTabItem("#2#")
$Input2_1 = GUICtrlCreateInput("< input folder >", 20, 25, 445, 20)
$Input2_2 = GUICtrlCreateInput("< input folder >", 20, 45, 445, 20)
$Input2_3 = GUICtrlCreateInput("< input folder >", 20, 65, 445, 20)
$Input2_4 = GUICtrlCreateInput("< input folder >", 20, 85, 445, 20)
$Input2_5 = GUICtrlCreateInput("< input folder >", 20, 105, 445, 20)
$Input2_6 = GUICtrlCreateInput("< input folder >", 20, 125, 445, 20)
$Input2_7 = GUICtrlCreateInput("< input folder >", 20, 145, 445, 20)
$Input2_8 = GUICtrlCreateInput("< input folder >", 20, 165, 445, 20)
$Input2_9 = GUICtrlCreateInput("< input folder >", 20, 185, 445, 20)
$Input2_10 = GUICtrlCreateInput("< input folder >", 20, 205, 445, 20)

$Button2_1 = GUICtrlCreateButton("Open / Run", 470, 25, 80, 20)
$Button2_2 = GUICtrlCreateButton("Open / Run", 470, 45, 80, 20)
$Button2_3 = GUICtrlCreateButton("Open / Run", 470, 65, 80, 20)
$Button2_4 = GUICtrlCreateButton("Open / Run", 470, 85, 80, 20)
$Button2_5 = GUICtrlCreateButton("Open / Run", 470, 105, 80, 20)
$Button2_6 = GUICtrlCreateButton("Open / Run", 470, 125, 80, 20)
$Button2_7 = GUICtrlCreateButton("Open / Run", 470, 145, 80, 20)
$Button2_8 = GUICtrlCreateButton("Open / Run", 470, 165, 80, 20)
$Button2_9 = GUICtrlCreateButton("Open / Run", 470, 185, 80, 20)
$Button2_10 = GUICtrlCreateButton("Open / Run", 470, 205, 80, 20)

; === TAB item 3 ===
$tab_3 = GUICtrlCreateTabItem("#3#")
$Input3_1 = GUICtrlCreateInput("< input folder >", 20, 25, 445, 20)
$Input3_2 = GUICtrlCreateInput("< input folder >", 20, 45, 445, 20)
$Input3_3 = GUICtrlCreateInput("< input folder >", 20, 65, 445, 20)
$Input3_4 = GUICtrlCreateInput("< input folder >", 20, 85, 445, 20)
$Input3_5 = GUICtrlCreateInput("< input folder >", 20, 105, 445, 20)
$Input3_6 = GUICtrlCreateInput("< input folder >", 20, 125, 445, 20)
$Input3_7 = GUICtrlCreateInput("< input folder >", 20, 145, 445, 20)
$Input3_8 = GUICtrlCreateInput("< input folder >", 20, 165, 445, 20)
$Input3_9 = GUICtrlCreateInput("< input folder >", 20, 185, 445, 20)
$Input3_10 = GUICtrlCreateInput("< input folder >", 20, 205, 445, 20)

$Button3_1 = GUICtrlCreateButton("Open / Run", 470, 25, 80, 20)
$Button3_2 = GUICtrlCreateButton("Open / Run", 470, 45, 80, 20)
$Button3_3 = GUICtrlCreateButton("Open / Run", 470, 65, 80, 20)
$Button3_4 = GUICtrlCreateButton("Open / Run", 470, 85, 80, 20)
$Button3_5 = GUICtrlCreateButton("Open / Run", 470, 105, 80, 20)
$Button3_6 = GUICtrlCreateButton("Open / Run", 470, 125, 80, 20)
$Button3_7 = GUICtrlCreateButton("Open / Run", 470, 145, 80, 20)
$Button3_8 = GUICtrlCreateButton("Open / Run", 470, 165, 80, 20)
$Button3_9 = GUICtrlCreateButton("Open / Run", 470, 185, 80, 20)
$Button3_10 = GUICtrlCreateButton("Open / Run", 470, 205, 80, 20)

; === TAB item 4 ===
$tab_4 = GUICtrlCreateTabItem("#4#")
$Input4_1 = GUICtrlCreateInput("< input folder >", 20, 25, 445, 20)
$Input4_2 = GUICtrlCreateInput("< input folder >", 20, 45, 445, 20)
$Input4_3 = GUICtrlCreateInput("< input folder >", 20, 65, 445, 20)
$Input4_4 = GUICtrlCreateInput("< input folder >", 20, 85, 445, 20)
$Input4_5 = GUICtrlCreateInput("< input folder >", 20, 105, 445, 20)
$Input4_6 = GUICtrlCreateInput("< input folder >", 20, 125, 445, 20)
$Input4_7 = GUICtrlCreateInput("< input folder >", 20, 145, 445, 20)
$Input4_8 = GUICtrlCreateInput("< input folder >", 20, 165, 445, 20)
$Input4_9 = GUICtrlCreateInput("< input folder >", 20, 185, 445, 20)
$Input4_10 = GUICtrlCreateInput("< input folder >", 20, 205, 445, 20)

$Button4_1 = GUICtrlCreateButton("Open / Run", 470, 25, 80, 20)
$Button4_2 = GUICtrlCreateButton("Open / Run", 470, 45, 80, 20)
$Button4_3 = GUICtrlCreateButton("Open / Run", 470, 65, 80, 20)
$Button4_4 = GUICtrlCreateButton("Open / Run", 470, 85, 80, 20)
$Button4_5 = GUICtrlCreateButton("Open / Run", 470, 105, 80, 20)
$Button4_6 = GUICtrlCreateButton("Open / Run", 470, 125, 80, 20)
$Button4_7 = GUICtrlCreateButton("Open / Run", 470, 145, 80, 20)
$Button4_8 = GUICtrlCreateButton("Open / Run", 470, 165, 80, 20)
$Button4_9 = GUICtrlCreateButton("Open / Run", 470, 185, 80, 20)
$Button4_10 = GUICtrlCreateButton("Open / Run", 470, 205, 80, 20)

GUICtrlCreateTabItem("")  ; end tabitem definition
; ======================================================================
; === Lees het INI bestand en geef de Input de bijbehorende waarden. ===
$var0 = IniReadSection(@ScriptDir & "\tab.ini", "TabNames")
GUICtrlSetData($tab_1, $var0[1] [1])
GUICtrlSetData($tab_2, $var0[2] [1])
GUICtrlSetData($tab_3, $var0[3] [1])
GUICtrlSetData($tab_4, $var0[4] [1])

$var0_1 = IniReadSection(@ScriptDir & "\tab.ini", "TabShow")
If $var0_1[1] [1] = 1 Then
    GUICtrlSetState($ChkTabShow, $GUI_CHECKED)
    GUICtrlSetState($var0_1[2] [1], $GUI_SHOW)
EndIf

$var1 = IniReadSection(@ScriptDir & "\tab.ini", "Tab1")
GUICtrlSetData($Input1_1, $var1[1] [1])
GUICtrlSetData($Input1_2, $var1[2] [1])
GUICtrlSetData($Input1_3, $var1[3] [1])
GUICtrlSetData($Input1_4, $var1[4] [1])
GUICtrlSetData($Input1_5, $var1[5] [1])
GUICtrlSetData($Input1_6, $var1[6] [1])
GUICtrlSetData($Input1_7, $var1[7] [1])
GUICtrlSetData($Input1_8, $var1[8] [1])
GUICtrlSetData($Input1_9, $var1[9] [1])
GUICtrlSetData($Input1_10, $var1[10] [1])

$var2 = IniReadSection(@ScriptDir & "\tab.ini", "Tab2")
GUICtrlSetData($Input2_1, $var2[1] [1])
GUICtrlSetData($Input2_2, $var2[2] [1])
GUICtrlSetData($Input2_3, $var2[3] [1])
GUICtrlSetData($Input2_4, $var2[4] [1])
GUICtrlSetData($Input2_5, $var2[5] [1])
GUICtrlSetData($Input2_6, $var2[6] [1])
GUICtrlSetData($Input2_7, $var2[7] [1])
GUICtrlSetData($Input2_8, $var2[8] [1])
GUICtrlSetData($Input2_9, $var2[9] [1])
GUICtrlSetData($Input2_10, $var2[10] [1])

$var3 = IniReadSection(@ScriptDir & "\tab.ini", "Tab3")
GUICtrlSetData($Input3_1, $var3[1] [1])
GUICtrlSetData($Input3_2, $var3[2] [1])
GUICtrlSetData($Input3_3, $var3[3] [1])
GUICtrlSetData($Input3_4, $var3[4] [1])
GUICtrlSetData($Input3_5, $var3[5] [1])
GUICtrlSetData($Input3_6, $var3[6] [1])
GUICtrlSetData($Input3_7, $var3[7] [1])
GUICtrlSetData($Input3_8, $var3[8] [1])
GUICtrlSetData($Input3_9, $var3[9] [1])
GUICtrlSetData($Input3_10, $var3[10] [1])

$var4 = IniReadSection(@ScriptDir & "\tab.ini", "Tab4")
GUICtrlSetData($Input4_1, $var4[1] [1])
GUICtrlSetData($Input4_2, $var4[2] [1])
GUICtrlSetData($Input4_3, $var4[3] [1])
GUICtrlSetData($Input4_4, $var4[4] [1])
GUICtrlSetData($Input4_5, $var4[5] [1])
GUICtrlSetData($Input4_6, $var4[6] [1])
GUICtrlSetData($Input4_7, $var4[7] [1])
GUICtrlSetData($Input4_8, $var4[8] [1])
GUICtrlSetData($Input4_9, $var4[9] [1])
GUICtrlSetData($Input4_10, $var4[10] [1])

GUISetState()
_ReduceMemory()
While 1
    $trayMsg = TrayGetMsg()
    $msg = GUIGetMsg()
    
    Select
        Case $msg = $BRename1
            opt("GUIEventCompatibilityMode", 0)
            $TabNr = GUICtrlRead($tab)
            $TabVar = IniRead(@ScriptDir & "\tab.ini", "TabNames", $TabNr, "")
            $TabRename = InputBox("Title", "The current Tab-Name =  [ " & $TabVar & " ]" _
                     & @CRLF & "Would you like to rename this Tab?" _
                     & @CRLF & @CRLF & "If not, leave the line blank")
            If $TabRename <> "" Then
                opt("GUIEventCompatibilityMode", 2)
                GUICtrlSetData(GUICtrlRead($tab), $TabRename)
                IniWrite(@ScriptDir & "\tab.ini", "TabNames", $TabNr, $TabRename)
            EndIf
        Case $trayMsg = $TrayName
            MsgBox(64, $Name, @CRLF & $Name & " v." & $Versie _
                     & @CRLF & @CRLF & "Created by : DaLiMan")
        Case $msg = $BSave1
            SaveScript()
        Case $msg = $GUI_EVENT_CLOSE
            $ShutDown = 1
            SaveScript()
        Case $trayMsg = $TrayExit
            $ShutDown = 1
            SaveScript()
        Case $msg = $GUI_EVENT_MINIMIZE
            GUISetState(@SW_HIDE);hide GUI
            opt("TrayIconHide", 0);show tray icon
            _ReduceMemory()
        Case $trayMsg = $TrayRestWindow
            GUISetState(@SW_SHOW);show GUI
            GUISetState(@SW_RESTORE)
            opt("TrayIconHide", 1);hide tray icon
        ; === Knoppen TAB1 ===
        Case $msg = $Button1_1
            _RunFileProg(GUICtrlRead($Input1_1))
        Case $msg = $Button1_2
            _RunFileProg(GUICtrlRead($Input1_2))
        Case $msg = $Button1_3
            _RunFileProg(GUICtrlRead($Input1_3))
        Case $msg = $Button1_4
            _RunFileProg(GUICtrlRead($Input1_4))
        Case $msg = $Button1_5
            _RunFileProg(GUICtrlRead($Input1_5))
        Case $msg = $Button1_6
            _RunFileProg(GUICtrlRead($Input1_6))
        Case $msg = $Button1_7
            _RunFileProg(GUICtrlRead($Input1_7))
        Case $msg = $Button1_8
            _RunFileProg(GUICtrlRead($Input1_8))
        Case $msg = $Button1_9
            _RunFileProg(GUICtrlRead($Input1_9))
        Case $msg = $Button1_10
            _RunFileProg(GUICtrlRead($Input1_10))
        ; === Knoppen TAB2 ===
        Case $msg = $Button2_1
            _RunFileProg(GUICtrlRead($Input2_1))
        Case $msg = $Button2_2
            _RunFileProg(GUICtrlRead($Input2_2))
        Case $msg = $Button2_3
            _RunFileProg(GUICtrlRead($Input2_3))
        Case $msg = $Button2_4
            _RunFileProg(GUICtrlRead($Input2_4))
        Case $msg = $Button2_5
            _RunFileProg(GUICtrlRead($Input2_5))
        Case $msg = $Button2_6
            _RunFileProg(GUICtrlRead($Input2_6))
        Case $msg = $Button2_7
            _RunFileProg(GUICtrlRead($Input2_7))
        Case $msg = $Button2_8
            _RunFileProg(GUICtrlRead($Input2_8))
        Case $msg = $Button2_9
            _RunFileProg(GUICtrlRead($Input2_9))
        Case $msg = $Button2_10
            _RunFileProg(GUICtrlRead($Input2_10))
        ; === Knoppen TAB3 ===
        Case $msg = $Button3_1
            _RunFileProg(GUICtrlRead($Input3_1))
        Case $msg = $Button3_2
            _RunFileProg(GUICtrlRead($Input3_2))
        Case $msg = $Button3_3
            _RunFileProg(GUICtrlRead($Input3_3))
        Case $msg = $Button3_4
            _RunFileProg(GUICtrlRead($Input3_4))
        Case $msg = $Button3_5
            _RunFileProg(GUICtrlRead($Input3_5))
        Case $msg = $Button3_6
            _RunFileProg(GUICtrlRead($Input3_6))
        Case $msg = $Button3_7
            _RunFileProg(GUICtrlRead($Input3_7))
        Case $msg = $Button3_8
            _RunFileProg(GUICtrlRead($Input3_8))
        Case $msg = $Button3_9
            _RunFileProg(GUICtrlRead($Input3_9))
        Case $msg = $Button3_10
            _RunFileProg(GUICtrlRead($Input3_10))
        ; === Knoppen TAB4 ===
        Case $msg = $Button4_1
            _RunFileProg(GUICtrlRead($Input4_1))
        Case $msg = $Button4_2
            _RunFileProg(GUICtrlRead($Input4_2))
        Case $msg = $Button4_3
            _RunFileProg(GUICtrlRead($Input4_3))
        Case $msg = $Button4_4
            _RunFileProg(GUICtrlRead($Input4_4))
        Case $msg = $Button4_5
            _RunFileProg(GUICtrlRead($Input4_5))
        Case $msg = $Button4_6
            _RunFileProg(GUICtrlRead($Input4_6))
        Case $msg = $Button4_7
            _RunFileProg(GUICtrlRead($Input4_7))
        Case $msg = $Button4_8
            _RunFileProg(GUICtrlRead($Input4_8))
        Case $msg = $Button4_9
            _RunFileProg(GUICtrlRead($Input4_9))
        Case $msg = $Button4_10
            _RunFileProg(GUICtrlRead($Input4_10))
            
        Case Else
        ;;;
    EndSelect
WEnd

Func SaveScript()
;~  MsgBox(0,"", GUICtrlRead($Input1_1) )
    If GUICtrlRead($ChkTabShow) = 1 Then
        opt("GUIEventCompatibilityMode", 2)
        IniWrite(@ScriptDir & "\Tab.ini", "TabShow", "Name", GUICtrlRead($tab))
        IniWrite(@ScriptDir & "\Tab.ini", "TabShow", "Rmbr", 1)
    Else
        IniWrite(@ScriptDir & "\Tab.ini", "TabShow", "Rmbr", 0)
    EndIf
                
    opt("GUIEventCompatibilityMode", 0)
    IniWrite(@ScriptDir & "\Tab.ini", "Tab1", "1", GUICtrlRead($Input1_1))
    IniWrite(@ScriptDir & "\Tab.ini", "Tab1", "2", GUICtrlRead($Input1_2))
    IniWrite(@ScriptDir & "\Tab.ini", "Tab1", "3", GUICtrlRead($Input1_3))
    IniWrite(@ScriptDir & "\Tab.ini", "Tab1", "4", GUICtrlRead($Input1_4))
    IniWrite(@ScriptDir & "\Tab.ini", "Tab1", "5", GUICtrlRead($Input1_5))
    IniWrite(@ScriptDir & "\Tab.ini", "Tab1", "6", GUICtrlRead($Input1_6))
    IniWrite(@ScriptDir & "\Tab.ini", "Tab1", "7", GUICtrlRead($Input1_7))
    IniWrite(@ScriptDir & "\Tab.ini", "Tab1", "8", GUICtrlRead($Input1_8))
    IniWrite(@ScriptDir & "\Tab.ini", "Tab1", "9", GUICtrlRead($Input1_9))
    IniWrite(@ScriptDir & "\Tab.ini", "Tab1", "10", GUICtrlRead($Input1_10))
    
    IniWrite(@ScriptDir & "\Tab.ini", "Tab2", "1", GUICtrlRead($Input2_1))
    IniWrite(@ScriptDir & "\Tab.ini", "Tab2", "2", GUICtrlRead($Input2_2))
    IniWrite(@ScriptDir & "\Tab.ini", "Tab2", "3", GUICtrlRead($Input2_3))
    IniWrite(@ScriptDir & "\Tab.ini", "Tab2", "4", GUICtrlRead($Input2_4))
    IniWrite(@ScriptDir & "\Tab.ini", "Tab2", "5", GUICtrlRead($Input2_5))
    IniWrite(@ScriptDir & "\Tab.ini", "Tab2", "6", GUICtrlRead($Input2_6))
    IniWrite(@ScriptDir & "\Tab.ini", "Tab2", "7", GUICtrlRead($Input2_7))
    IniWrite(@ScriptDir & "\Tab.ini", "Tab2", "8", GUICtrlRead($Input2_8))
    IniWrite(@ScriptDir & "\Tab.ini", "Tab2", "9", GUICtrlRead($Input2_9))
    IniWrite(@ScriptDir & "\Tab.ini", "Tab2", "10", GUICtrlRead($Input2_10))
    
    IniWrite(@ScriptDir & "\Tab.ini", "Tab3", "1", GUICtrlRead($Input3_1))
    IniWrite(@ScriptDir & "\Tab.ini", "Tab3", "2", GUICtrlRead($Input3_2))
    IniWrite(@ScriptDir & "\Tab.ini", "Tab3", "3", GUICtrlRead($Input3_3))
    IniWrite(@ScriptDir & "\Tab.ini", "Tab3", "4", GUICtrlRead($Input3_4))
    IniWrite(@ScriptDir & "\Tab.ini", "Tab3", "5", GUICtrlRead($Input3_5))
    IniWrite(@ScriptDir & "\Tab.ini", "Tab3", "6", GUICtrlRead($Input3_6))
    IniWrite(@ScriptDir & "\Tab.ini", "Tab3", "7", GUICtrlRead($Input3_7))
    IniWrite(@ScriptDir & "\Tab.ini", "Tab3", "8", GUICtrlRead($Input3_8))
    IniWrite(@ScriptDir & "\Tab.ini", "Tab3", "9", GUICtrlRead($Input3_9))
    IniWrite(@ScriptDir & "\Tab.ini", "Tab3", "10", GUICtrlRead($Input3_10))
    
    IniWrite(@ScriptDir & "\Tab.ini", "Tab4", "1", GUICtrlRead($Input4_1))
    IniWrite(@ScriptDir & "\Tab.ini", "Tab4", "2", GUICtrlRead($Input4_2))
    IniWrite(@ScriptDir & "\Tab.ini", "Tab4", "3", GUICtrlRead($Input4_3))
    IniWrite(@ScriptDir & "\Tab.ini", "Tab4", "4", GUICtrlRead($Input4_4))
    IniWrite(@ScriptDir & "\Tab.ini", "Tab4", "5", GUICtrlRead($Input4_5))
    IniWrite(@ScriptDir & "\Tab.ini", "Tab4", "6", GUICtrlRead($Input4_6))
    IniWrite(@ScriptDir & "\Tab.ini", "Tab4", "7", GUICtrlRead($Input4_7))
    IniWrite(@ScriptDir & "\Tab.ini", "Tab4", "8", GUICtrlRead($Input4_8))
    IniWrite(@ScriptDir & "\Tab.ini", "Tab4", "9", GUICtrlRead($Input4_9))
    IniWrite(@ScriptDir & "\Tab.ini", "Tab4", "10", GUICtrlRead($Input4_10))
    
    If $ShutDown = 1 Then Exit
EndFunc  ;==>SaveScript

Func _ResetWindow()
    GUISetState(@SW_SHOW);show GUI
    GUISetState(@SW_RESTORE)
    opt("TrayIconHide", 1);hide tray icon
EndFunc  ;==>_ResetWindow

Func _RunFileProg($FileProg)
;~ MsgBox(0,"",$FileProg)
    If StringLeft(StringRight(StringStripWS($FileProg, 3), 4), 1) = "." Then
        $FileProg = FileGetShortName($FileProg)
        Run(@ComSpec & " /c " & $FileProg, "", @SW_HIDE)
    Else
        Run("explorer.exe /e," & $FileProg, "")
    EndIf
        GUISetState(@SW_HIDE);hide GUI
        opt("TrayIconHide", 0);show tray icon
        _ReduceMemory()
        
EndFunc  ;==>_RunFileProg

Func _ReduceMemory($i_PID = -1)
    $memory_counter = 1
    If $i_PID <> - 1 Then
        Local $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', 0x1f0fff, 'int', False, 'int', $i_PID)
        Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', $ai_Handle[0])
        DllCall('kernel32.dll', 'int', 'CloseHandle', 'int', $ai_Handle[0])
    Else
        Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', -1)
    EndIf
    Return $ai_Return[0]
EndFunc  ;==>_ReduceMemory
Link to comment
Share on other sites

If anyone is interested, I modded the code a bit. Removed full screen explorer (before you added the option

@DaLiMan), resized the gui a bit smaller to fit my working environment better, and added minimize to tray after opening a folder, since I rarely open more than one at a clip.

That's a nice option, I think I'll put that one in too...... :think:

I do have one question @DaLiMan, what exactly does the _ReduceMemory function do?

That function is not mine, but it a very nice adding to almost every script.

It actually does exacty what it say's. It reduces the memery useage of the script. (or any other program if you want it to!!)

More info can be found here:

http://www.autoitscript.com/forum/index.ph...duceMemory&st=0

Here's a good place to look for additions for your script :(

Link to comment
Share on other sites

DaLiMan thank you for the code, I do like a lot the idea. I played around with the code and reduce the size of the script to about half.

Hi Danny35sd,

I'm glad you like it and thanks for reducing the code. May I use it in the next release?

I was planning of shrinking it but did not yet know how and haven't had the time to figure it out.

This will be a nice tutor for me. :think:

Link to comment
Share on other sites

  • 4 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...