ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Finished Programs

PutAside: declutter and cycle through windows

<< < (2/6) > >>

justice:
Thanks for the feedback!
AnyM,sorry I've sent you the source in a PM, you can also view it below.
Grorgy,thanks for that. it definately shouldn't hide the cursor  :o I guess you are not using windows XP like me? Could you tell me your configuration and if you have any mouse utilities running?
Lanux128, I was thinking the app should really start without doing anything, with a key toggle and menu option one could enable/disable it. I'll get this done today. The exception list is a great idea and will definately get in too.

Grorgy:
hi Justice,
Ahhaaa, I usually have cursorxp running, (a cursor enhancement program if you dont know it). It works perfectly as soon as i disable it.  :), So thats good to know, i'll just make sure i disable it b4 running your handy little app when i need it , (I do run XP with SP2 and all the patches microsoft have sent out) 

Cheers
George

justice:
Thanks that explains it. I am working on excluding applications for the next version straight from the tray menu.

justice:
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:


New in BETA02:
* Shift-scrolllock to hide / restore window (or via tray menu)
* Tray menu!!
* Exclude processes via system tray  :Thmbsup:
* Save these settings permanently in Application Data
* Fixed several counting and implementation bugs in hiding, cycling and showing windows

Todo:
* Customizable hotkeys

cthorpe:
Love it!

I think it will be very useful for me as a teacher.  I have a LCD projector connected to my computer, and I am often showing demonstrations, multimedia, etc.  Sometimes the students get distracted by trying to guess what the programs in my taskbar do.  This will let me hide whatever else I am working on, and just show them a clean desktop like they see on their screens.

Beta 2 - So far no problems.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version