But because this is not possible at the moment, I wrote a little Autohotkey Script:
Code: Select all
#SingleInstance off
; Run programm and save PID
Run salamand.exe, , , NewPID
; set icon for script
menu, tray, Icon , salamand.exe, 4, 1
; No tray items
menu, tray, NoStandard
; add show item
menu, tray, add, Show
; add hide item
menu, tray, add, Hide
; add seperator
menu, tray, add
; add exit item
menu, tray, add, Exit
; set it default
menu, tray, default, Show
; show it with one single click
menu, tray, Click, 1
WinWait, ahk_pid %NewPID%
{
; get window title for tray tool tip
WinGetTitle, TheWinTitle, ahk_pid %NewPID%
; hide window
WinHide, ahk_pid %NewPID%
}
; set tooltip for icon
menu, tray, Tip, %TheWinTitle%
; close this app when the process is gone
Process, WaitClose, %NewPID%
ExitApp
^!S::
{
showhideWin(NewPID)
}
Return
; function that show and hides the window
showhideWin(NewPID)
{
; Hide window if active
IfWinActive, ahk_pid %NewPID%
{
; get window title for tray tool tip
WinGetTitle, TheWinTitle, ahk_pid %NewPID%
; set tooltip for icon
menu, tray, Tip, %TheWinTitle%
; hide window
WinHide, ahk_pid %NewPID%
}
else
{
; show Window
WinGet, WinStat, MinMax, ahk_pid %NewPID%
IfEqual, WinStat, -1
{
WinRestore, ahk_pid %NewPID%
}
else
{
; show window
WinShow, ahk_pid %NewPID%
}
; and set active
WinActivate, ahk_pid %NewPID%
; get window title for tray tool tip
WinGetTitle, TheWinTitle, ahk_pid %NewPID%
; set tooltip for icon
menu, tray, Tip, %TheWinTitle%
}
return
}
Hide:
{
; get window title for tray tool tip
WinGetTitle, TheWinTitle, ahk_pid %NewPID%
; set tooltip for icon
menu, tray, Tip, %TheWinTitle%
; hide window
WinHide, ahk_pid %NewPID%
}
return
Exit:
{
; show window (because it is possible, that it asks s.th.)
WinShow, ahk_pid %NewPID%
; Close app
WinClose, ahk_pid %NewPID%
}
return
Show:
{
; here we can call showhide, because the window will never hide, because
; it does not have the focus in the moment we click the icon or the menu entry
showhideWin(NewPID)
}
return
Usage:
Start the salamand_tray.exe instead of the salamand.exe. It will start Salamander and hide it. To bring Salamander to the front, simply click the tray icon or press the keyboard shortcut CTRL+ALT+S. Press again to hide it.
Attention: You have to disable the option "minimize to tray" in the salamander configuration !
Hope you have fun with this.
If you want...
... an other keyboard shortcut
... or an other icon
... or that the window is shown after startup
feel free to change the script and recompile it for yourself.