Start HideToTray, doubleclick it's tray icon to hide the active window to the tray, showing the program's icon. Doubleclick the new icon to unhide it again, rightclick to show a menu. The procedure can be done again to hide more windows.
It consists of two scripts. HideToTray is used to run HideWin.
HideWin must be compiled to allow it to receive parameters.
It's far from perfect - you can hide the same window several times. Maybe spawning GUIs would be a better solution?
Skrommel
HideToTray:
;HideToTray SetWorkingDir,"%A_ScriptDir%" Menu,Tray,NoStandard Menu,Tray,Add,&Hide Active Window,HIDE Menu,Tray,Default,&Hide active window Menu,Tray,Add,E&xit,EXIT START: Gosub,GETWINDOW Sleep,999 Goto,START HIDE: Run,hidewin.exe "%window%","%A_ScriptDir%" Return GETWINDOW: WinGet,window0,ID,A WinGetClass,class,ahk_id %window0% If class<> If class<>Shell_TrayWnd If class<>AutoHotkey window=%window0% Return EXIT: ExitApp
HideWin: must be compiled into HideWin.exe
;HideWin must be compiled into HideWin.exe window=%1% DetectHiddenWindows,On Gosub,HIDE START: Gosub,READICON Gosub,GETMAXIMIZE Gosub,GETONTOP Gosub,GETTRANSPARENT Sleep,999 Goto,START HIDE: SetTimer,READICON,Off Gosub,READICON WinGetTitle,title,ahk_id %window% Menu,Tray,Icon,%path%,1 Menu,Tray,Tip,%info% - %title% usermenu=UnHide Gosub,ADDMENU WinHide,ahk_id %window% Return UNHIDE: usermenu=Hide Gosub,ADDMENU WinShow,ahk_id %window% WinActivate,ahk_id %window% SetTimer,READICON,On Return ADDMENU: Menu,Tray,NoStandard Menu,Tray,DeleteAll Menu,Tray,Add,%usermenu% Menu,Tray,Default,%usermenu% Menu,Tray,Add,Maximize,MAXIMIZE Menu,Tray,Add,OnTop,ONTOP Menu,Tray,Add,Transparent,TRANSPARENT If maximize=1 Menu,Tray,Check,Maximize Else Menu,Tray,UnCheck,Maximize If ontop=1 Menu,Tray,Check,OnTop Else Menu,Tray,UnCheck,OnTop If transparent=1 Menu,Tray,Check,Transparent Else Menu,Tray,UnCheck,Transparent Menu,Tray,Add,&Release,RELEASE Menu,Tray,Add,E&xit,EXIT Return MAXIMIZE: If maximize=1 WinRestore,ahk_id %window% Else WinMaximize,ahk_id %window% Gosub,GETMAXIMIZE Gosub,ADDMENU Return ONTOP: If ontop=1 WinSet,AlwaysOnTop,Off,ahk_id %window% Else WinSet,AlwaysOnTop,On,ahk_id %window% Gosub,GETONTOP Gosub,ADDMENU Return TRANSPARENT: If transparent=1 WinSet,Transparent,Off,ahk_id %window% Else WinSet,Transparent,122,ahk_id %window% Gosub,GETTRANSPARENT Gosub,ADDMENU Return GETMAXIMIZE: WinGet,maximize,MinMax,ahk_id %window% Return GETONTOP: WinGet,ontop,ExStyle,ahk_id %window% Transform,ontop,BitAnd,%ontop%,0x8 If ontop<>0 ontop=1 Else ontop=0 Return GETTRANSPARENT: WinGet,transparent,Transparent,ahk_id %window% If transparent>0 transparent=1 Else transparent=0 Return READICON: WinGet,file,ProcessName,ahk_id %window% If file= Goto,EXIT Loop,HKEY_CURRENT_USER,Software\Microsoft\Windows\ShellNoRoam\MUICache,0,0 { IfInString,A_LoopRegName,%file% { RegRead,info path=%A_LoopRegName% Break } } Return RELEASE: Gosub,UNHIDE ExitApp EXIT: Gosub,UNHIDE WinClose,ahk_id %window% ExitApp