Da ich mittlerweile auch den freeCommander nutze, habe ich ebenfalls ein
Skript dafür geschrieben. Vielleicht kann es ja noch einer von euch gebrauchen
EDIT:
kleinere Verbesserungen + Fehlerbehebungen
EDIT2:
+singleton
+beenden mit Gewissensprüfung
+tooltip
gespoilert
EDIT3:
+Anzeige der Programmfavoriten
Spoiler anzeigen
C
#region CommonSettings
#include <GUIConstants.au3>
#Include <GuiCombo.au3>
;~ #NoTrayIcon
Opt("MustDeclareVars",1)
Opt("WinTitleMatchMode",2)
_Singleton("23583D491449D4400F829A7D95E0C54D")
#endregion
#region GlobalVars
Dim $Form1, $combo1, $msg, $fc, $close,$closeQuest, $refresh
Dim $aSectionKeys, $iFolders
Dim $curSelFolder = -1
Dim $dropped = -1
Dim $installLocation = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\freeCommander_is1","InstallLocation")
Dim $tool[1][2]
#endregion
#region GUI
$fc = ControlGetHandle("freeCommander", "", "TControlBar1")
$Form1 = GUICreate("OrdnerFavoriten", 230, 21, 100, 125,$WS_POPUPWINDOW + $WS_VISIBLE + $DS_SETFOREGROUND,$WS_EX_TOOLWINDOW, $fc)
$Combo1 = GUICtrlCreateCombo("", 0, 0, 209, 21)
GUICtrlSetResizing(-1,$GUI_DOCKALL)
$close = GUICtrlCreateButton("",232,0,21,21,$BS_ICON)
GUICtrlSetResizing(-1,$GUI_DOCKALL)
GUICtrlSetImage ( -1, "shell32.dll" ,215 ,1)
GUICtrlSetTip(-1,"beenden")
$refresh = GUICtrlCreateButton("",210,0,21,21,$BS_ICON)
GUICtrlSetResizing(-1,$GUI_DOCKALL)
GUICtrlSetImage ( -1, "shell32.dll" ,209,1)
GUICtrlSetTip(-1,"aktualisieren")
_fillCombo()
_ProgrammButtonBuilder()
GUISetState(@SW_SHOW)
While 1
$msg = GuiGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
ExitLoop
Case $msg = $close
$closeQuest = MsgBox(292,"Ordnerfavoriten schließen", "Sollen die Ordnerfavoriten wirklich geschlossen werden?")
If $closeQuest = 6 Then
ExitLoop
EndIf
Case $msg = $refresh
_fillCombo()
Case Else
For $j = 0 To UBound($tool)-1
If $msg = $tool[$j][0] Then
Run($tool[$j][1])
EndIf
Next
EndSelect
If (_GUICtrlComboGetDroppedState($Combo1) = True) Then
$dropped = 1
EndIf
If(_GUICtrlComboGetDroppedState($Combo1) = False) And $dropped = 1 Then
_changeHandler()
EndIf
_setPos()
WEnd
Exit
#endregion
#region Functions DirFavorit
;===============================================================================
;
; Function Name: _fillCombo()
; Description:: Reads the inisection [DirFavorit] of freeCommander.ini and
;~ adds each key to the combobox.
; Parameter(s): none
; Requirement(s): installed freeCommander, freeCommander.ini must be in the installfolder of freecommander
; Return Value(s): none
; Author(s): <jonk>
;
;===============================================================================
;
Func _fillCombo()
_GUICtrlComboResetContent($combo1)
Local $i
$aSectionKeys = IniReadSection($installLocation&"\freeCommander.ini","DirFavorit")
If IsArray($aSectionKeys) And Not @error Then
$iFolders = $aSectionKeys[0][0]
For $i = 1 To $iFolders
GUICtrlSetData($combo1,$aSectionKeys[$i][0])
Next
EndIf
EndFunc
;===============================================================================
;
; Function Name: _changeHandler()
; Description:: Checks if the selected entry of the combo has changed. If so,
;~ the function sends the shortcut to freeCommander
; Parameter(s): none
; Requirement(s): installed freeCommander, default shortcuts for favorite folders
; Return Value(s): none
; Author(s): <jonk>
;
;===============================================================================
;
Func _changeHandler()
Local $i
$curSelFolder = _GUICtrlComboGetCurSel($Combo1)
For $i = 0 To $iFolders
If $i = $curSelFolder Then
WinActivate ( "freeCommander")
Send("^+"&$i+1)
EndIf
Next
$dropped = -1
EndFunc
;===============================================================================
;
; Function Name: _setPos()
; Description:: Moves the ordnerfav to the desired Position
; Parameter(s): none
; Requirement(s): installed freeCommander
; Return Value(s): none
; Author(s): <jonk>
;
;===============================================================================
;
Func _setPos()
Local $pos
$pos = WinGetPos ( "freeCommander")
If $pos <>0 Then
WinMove ( "OrdnerFavoriten", "", $pos[0]+500, $pos[1] + 23)
Else
Exit
EndIf
EndFunc
#endregion
#region - Functions ProgFavorit
;===============================================================================
;
; Function Name: _ProgrammButtonBuilder()
; Description:: Reads the userdefind Programms from freeCommander.ini and builds
;~ appropriate buttons
; Parameter(s): none
; Requirement(s): installed freeCommander, freeCommander.ini must be in the installfolder of freecommander
; Return Value(s): none
; Author(s): <jonk>
;
;===============================================================================
;
Func _ProgrammButtonBuilder()
Local $aSectionKeys, $iTools, $aToolParam,$pos,$i
$aSectionKeys = IniReadSection($installLocation&"\freeCommander.ini","Tools")
If IsArray($aSectionKeys) And Not @error Then
$iTools = $aSectionKeys[0][0]
ReDim $tool[$iTools][2]
For $i = 1 To $iTools
$aToolParam = IniReadSection($installLocation&"\freeCommander.ini","Tools_"&$aSectionKeys[$i][1])
$tool[$i-1][0] = GUICtrlCreateButton("",250+$i*21,0,21,21,$BS_ICON)
$tool[$i-1][1] = $aToolParam[1][1]
GUICtrlSetResizing(-1,$GUI_DOCKALL)
GUICtrlSetImage ( -1, $aToolParam[1][1],0,0)
GuiCtrlSetTip(-1,$aSectionKeys[$i][1])
Next
$pos = WinGetPos ( "freeCommander")
WinMove ( "OrdnerFavoriten", "","","",250+($iTools+1)*21)
EndIf
EndFunc
#endregion
Alles anzeigen