I don't want to release another half tested release, but additional testing would be welcome. Things like incompatible applications, missing windows in cycles etc. I am using PutAside all day now and if all is well I will release a compiled version at the end of the week:
AutoHotkey Code
; PutAside03 by justice
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
#SingleInstance,Force
SetWinDelay,0
Dir = %A_AppData%\PutAside
IniFile = settings.ini
FileCreateDir, %Dir%
SetWorkingDir, %Dir%
version = Beta02
ExclusionList =
Processes =
IDs =
Titles =
maxItems =
PutAsideEnabled =
this_windowcycle =
Gosub,READINI
Gosub,IndexWindows
OnExit, QUIT
GoSub, Standby
; End of initialisation
IndexWindows:
Traytip,PutAside, Shift-ScrollLock`t Put aside / restore windows.`nScrollLock`t Cycle through hidden windows.
WinGet, id, list,,, Program Manager ; get list of all foreground ids
Loop, %id%
{
this_id := id%A_Index%
WinGet, this_process, ProcessName, ahk_id %this_id%
if NOT this_process ;exclude emptiness
continue
WinGetTitle, this_title, ahk_id %this_id%
if NOT this_title ;exclude start menu and empty processes
continue
StringGetPos, pos, ExclusionList, %this_process%
i +=1
Processes%i% := this_process
Titles%i% := this_title
IDs%i% := this_id
}
id =
maxItems := i
GoSub, TRAYMENU
return
READINI:
IfNotExist, %IniFile%
GoSub, WRITEINI
IniRead, ExclusionList, %IniFile%,ExclusionList, list
return
WRITEINI:
IniWrite, %ExclusionList%, %IniFile%, ExclusionList, list
return
TRAYMENU:
Menu,Tray,NoStandard
Menu,Tray,DeleteAll
If maxItems ; if windows have been indexed
{
Loop, %maxItems% ; add checkboxes for every window
{
this_process := Processes%A_Index%
Menu, ToggleStatus, add, %this_process%,ToggleStatus
StringGetPos, pos, ExclusionList, %this_process%
if NOT ErrorLevel
Menu, ToggleStatus, Uncheck, %this_process%
else
Menu, ToggleStatus, Check, %this_process%
}
Menu, tray, add, E&nabled for.., :ToggleStatus
}
Menu,Tray,Add,
If PutAsideEnabled
Menu,Tray,Add,Restore windows,PutAside
Else
Menu,Tray,Add,Hide windows,PutAside
Menu,Tray,Add,
Menu,Tray,Add,&About,ABOUT
Menu,Tray,Add,&Bugs and Feedback...,ONLINE
Menu,Tray,Add,&Online Help,ONLINE
Menu,Tray,Add,
Menu,Tray,Add,&Exit,QUIT
Return
ABOUT:
Msgbox, PutAside %version% by justice`n`n`tPress SHIFT-SCROLLLOCK to hide and unhide all applications.`n`tPress SCROLLLOCK to cycle through hidden windows.`n`tExclude processes using the tray menu.
return
ONLINE:
Run,https://www.donationcoder.com/forum/index.php?topic=8626
return
QUIT:
GoSub, ShowWindows ; before exiting restore original situation
ExitApp
ToggleStatus:
Menu,ToggleStatus,ToggleCheck,%A_ThisMenuItem%
StringGetPos, pos, ExclusionList, %A_ThisMenuItem%
if NOT ErrorLevel ; found
StringReplace, ExclusionList, ExclusionList, %A_ThisMenuItem%`,,,
else
ExclusionList = %ExclusionList%%A_ThisMenuItem%`,
Gosub, WRITEINI
;Msgbox, %ExclusionList%
Return
ScrollLock::
If NOT PutAsideEnabled ;don't do anything
return
GoSub, CycleWindows
return
CycleWindows:
;hide last shown enabled window IF ENABLED
current_id := IDs%this_windowcycle%
StringGetPos, pos, ExclusionList, %this_process%
If ErrorLevel ; not found in exclusion list
{
WinHide, ahk_id %current_id% ;hide previously opened window
}
If this_windowcycle = %maxItems%
this_windowcycle = 0 ;cycle through windows from beginning
this_windowcycle++
;show next window
Loop, %maxItems%
{
this_id := IDs%this_windowcycle%
this_process := Processes%this_windowcycle%
StringGetPos, pos, ExclusionList, %this_process%
Traytip, PutAside, %this_windowcycle% - Restoring %this_process%
WinShow, ahk_id %this_id%
WinActivate, ahk_id %this_id%
If ErrorLevel ; not found in exclusion list
{
break
}
}
return
+ScrollLock::
GoSub, PutAside
return
PutAside:
If PutAsideEnabled
{
PutAsideEnabled =
GoSub, ShowWindows
}
Else
{
PutAsideEnabled = true
GoSub, HideWindows
}
return
ShowWindows:
Loop, %maxItems% ;show all hidden windows
{
next_id := IDs%A_Index%
WinShow, ahk_id %next_id%
}
return
HideWindows:
Traytip,PutAside, Putting aside windows..`nUse ScrollLock to cycle through them.
WinGet, id, list,,, Program Manager ; get list of all foreground ps
i= 0
Loop, %id%
{
this_id := id%A_Index%
WinGet, this_process, ProcessName, ahk_id %this_id%
if NOT this_process ;exclude emptiness
continue
WinGetTitle, this_title, ahk_id %this_id%
if NOT this_title ;exclude start menu and empty processes
continue
StringGetPos, pos, ExclusionList, %this_process%
If ErrorLevel ; not found in exclusion list
WinHide, ahk_id %this_id%
i +=1
Processes%i% := this_process
IDs%i% := this_id
}
id =
maxItems := i
GoSub, TRAYMENU
return
Standby:
* Fixed several counting and implementation bugs in hiding, cycling and showing windows