0
votes

I have been using 7+ Taskbar Tweaker for a day and I'm blown away with two features. Mainly because windows alt+tab is not memorising order of open windows in it. There are two commands that I use constantly. 101 - Switch to the window which is located on the left to the active window on the taskbar and Switch to the window which is located on the right to the active window on the taskbar.

So when I do some programming and have to switch between windows fast, I just assign shortcuts for those 2 operations. It's making switching between windows so easy. One key is moving focus left and other to do right.

Is it possible to do this in autohotkeys? It would be so awesome. Because actually I don't need whole program, only this feature. I saw some code for it on web but it's not working in win 7/64. Basically I need script that will assign hotkey for moving focus from active window on taskbar to one to the left or one to the right. Also when it run out of left/right windows it should circle back to starting window(like normal alt tab is doing.)

2
Yes, it's implemented in robertcollier4's TaskbarNavigation script. - wOxxOm
Yes I saw that first, but it's not working in win 7/64. - IGRACH

2 Answers

0
votes

Aw... yes I think I wrote a script could do just that some years ago, but I'm not sure how exactly I did it.
The real problem here is finding the order of the windows in the takbar.
But I can tell you there is no official api for it and from what I could tell using registry monitoring software, the order isn't stored in the registry.

For now, that's the only thing that comes to my mind:

F1::WinActivateByTbIndex(4) ;activate the fourth window in the task bar with F1
F2::WinActivateByTbIndex(2) ;activate the second window in the task bar with F2


WinActivateByTbIndex(index) {
    WinActivate, ahk_class Shell_TrayWnd
    ControlSend, MSTaskListWClass1, % "{Tab}{Right " index-1 "}", ahk_class Shell_TrayWnd
    Send, {Up}{Enter}
}  

But if you have multiple windows behind one taskbar icon, then you will just enable the first one, so that may not be too useful..

Windows also provides the hotkeys Win+1 up to Win+0 Win+2 ... upt to Win+0 as quick shortcuts to enable window 1-10, but it suffers from 2 limitations: It only works for the first 10 windows and you always activate the first window of a stack (just like my hotkeys).

0
votes

Actually I was reading about this a lot, and the alt + esc and alt+ shift +esc that is native in windows is doing a pretty good job of functionality that I need. It's cycling through open windows, in order that they were open. Only downside is that if you have minimized windows it will select them and they will stay minimized, it will not put them to front. I was tripped by this until I figure it out. One shortcut is for moving left and other right, you just have to open windows in order in which you would like to cycle through.

So.. alt+esc and alt+ shift+esc are working, but they are so hard to press, especially if you want to do that fast. Along came autohotkey, I tested this code and it's working flawlessly.

 !w::
   sendInput {alt down}{esc}{alt up}
  return

 !e::
   sendInput {alt down}{shift down}{esc}{alt up}{shift up}
  return