AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

deskpager and more controlling windows without a mouse

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
bearware
Guest





PostPosted: Fri Jul 15, 2005 11:24 am    Post subject: deskpager and more controlling windows without a mouse Reply with quote

Here a a mousless deskpager
and more ways to control windows without a mouse.

Code:

; a deskpager

;copyright richard delorenzi 2005
;you may use this acording to the GPL version 2

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; win      1,2,3,or 4 to switch desks
; win/ctrl 1,2,3,or 4 to move active window to desk
;
; win/esc        activate next window
; win       tab  activate next window current to back
; win/shift tab  reverse of above
; win s          show enabled windows. use to help debug


#SingleInstance
#MaxThreads 1

CurrentDeskId=1
Desk1=
Desk2=
Desk3=
Desk4=
OnExit,Goodbye

;comma seperated window exclusion lists
;Dont be doing any thing importent on your computer when editing this script,
;you may loose you windows.
;The following lists are not perfact
ClassExcludeList   = Shell_TrayWnd,IEDummyFrame,#32770,SysShadow,BaseBar
TitleExclusionList =


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; kotkeys

#1::
  gosub DeskAuditWindows
  gosub DeskHideWindows
  CurrentDeskId=1
  gosub DeskShowWindows
return

#2::
  gosub DeskAuditWindows
  gosub DeskHideWindows
  CurrentDeskId=2
  gosub DeskShowWindows
return

#3::
  gosub DeskAuditWindows
  gosub DeskHideWindows
  CurrentDeskId=3
  gosub DeskShowWindows
return

#4::
  gosub DeskAuditWindows
  gosub DeskHideWindows
  CurrentDeskId=4
  gosub DeskShowWindows
return

#^1::
  ToDeskId=1
  gosub DeskMoveWindow
return

#^2::
  ToDeskId=2
  gosub DeskMoveWindow
return

#^3::
  ToDeskId=3
  gosub DeskMoveWindow
return

#^4::
  ToDeskId=4
  gosub DeskMoveWindow
return

#l::
  reload
return

#Esc:: ;next window
  gosub GotoWindow
return

#+Tab::
  gosub GoToBackWindow
return

#Tab:: ;next window send current to back
  ;send to bottom
  WinSet,Bottom,,A
  gosub GotoWindow
return


#s:: ;show
  gosub DeskFullAuditWindows
  Text =
  Loop,Parse,DeskAuditList,CSV
  {
    Id = %A_LoopField%
    WinGetTitle,Title,ahk_id %Id%
    WinGetClass,Class,ahk_id %Id%
    WinGet,Process,ProcessName,ahk_id %Id%
    Text = %Text%%Id%,%Title%,%Class%,%Process%`n
  }
  MsgBox,%Text%
return

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
GotoWindow:
  ;activate next window
  gosub ReverseDeskAuditWindows
  ;MsgBox,List: %DeskAuditList%   
  Loop,Parse,DeskAuditList,CSV
  {
    if A_LoopField
    {
      WinGet,State,MinMax,ahk_id %A_LoopField%
      ;MsgBox,%A_LoopField% %State%
      IfNotEqual,State,-1
      { 
        ;MsgBox,%A_LoopField%
        ifWinNotActive, ahk_id %A_LoopField%
        {
          WinActivate,ahk_id %A_LoopField%
          break
        }
      }
    }
  }
return

GoToBackWindow:
  WinActivateBottom,,,Program Manager
return

GoodBye:
  gosub DeskShowAllWindows
ExitApp

DeskMoveWindow:
  gosub DeskAuditWindows
  winget,thisid,Id,A
  If ThisId in %DeskAuditList%
  {
    ifNotEqual CurrentDeskId,%ToDeskId%
    {
      ListSoFar := Desk%ToDeskId%
      Desk%ToDeskId% = %ThisId%,%ListSoFar%
      WinHide,ahk_id %ThisId%
    }
  }
return

DeskShowAllWindows:
  Loop,4
  {
    ;hMsgBox,%A_index%
    CurrentDeskId=%A_Index%
    gosub DeskShowWindows
  }
return

ReverseDeskAuditWindows:
  gosub DeskAuditWindows
  List=
  Loop,Parse,DeskAuditList,CVS
  {
    List=%A_LoopField%,%List%
  }
  DeskAuditList=%List%
return

DeskAuditWindows:
  SetWinDelay,0
  DeskAuditList=
  WinGet,Windows,List,,,Program Manager
  Loop %Windows%
  {
    ThisId    := Windows%a_index%
    WinGetClass,Class,ahk_id %ThisId%
    WinGetTitle,Title,ahk_id %ThisId%
    If Class not in %ClassExcludeList%
    {
      If Title not in %TitleExclusionList%
      {
        ;MsgBox,Class:%Class%   
        ListSoFar = %DeskAuditList%
        DeskAuditList = %ListSoFar%,%ThisId%
      }
    }
  }
  ;MsgBox,%DeskAuditList%
return

DeskFullAuditWindows:
  SetWinDelay,0
  DeskAuditList=
  WinGet,Windows,List,,,Program Manager
  Loop %Windows%
  {
    ThisId    := Windows%a_index%
    ListSoFar = %DeskAuditList%
    DeskAuditList = %ListSoFar%,%ThisId%
  }
return


DeskHideWindows:
  SetWinDelay,0
  Desk%CurrentDeskId% = %DeskAuditList%
  CurrentDesk := Desk%CurrentDeskId%
  Loop,Parse,CurrentDesk,CSV
  {
    if %A_LoopField%
    {
      ;MsgBox,%A_LoopField%
      WinHide,ahk_id %A_LoopField%
    }
  }
return

DeskShowWindows:
  SetWinDelay,0
  SplashImage,,B,,Desk %CurrentDeskId%,VirtualDesktop_SplashScreen,FM10
  ;WinMove,VirtualDesktop_SplashScreen,,10,10
  WinSet,Transparent,128,VirtualDesktop_SplashScreen
 
  CurrentDesk := Desk%CurrentDeskId%
  Loop,Parse,CurrentDesk,CSV
  {
    if %A_LoopField%
    {
      ;MsgBox,%A_LoopField%
      WinShow,ahk_id %A_LoopField%
    }
  }
  SetTimer,DeskBannerOff,1000
return

DeskBannerOff:
  SplashImage,off
  SetTimer,DeskBannerOff,Off
return
Back to top
Guest






PostPosted: Sat Jul 16, 2005 10:55 am    Post subject: Reply with quote

What on earth?
my start bar jus disepears>??
jus goes missing, man i felt lost then.


does taht happen to every one????
Back to top
bearware
Guest





PostPosted: Mon Jul 25, 2005 10:30 am    Post subject: dissapearing windows Reply with quote

There is a list of windows to leave alone, but I produced it by experimentation, I would imagine that different versions of MSWindows would need different lists. If any one can make this less flacky it would be appriciated.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group