I’ve been using the Windows 7 release candidate (still available from Microsoft) as my main and only operating system on both a desktop and laptop for the last month. I like it a lot.
One of the biggest differences is the new taskbar, where you can pin the programs you use most for easy access. In effect, the taskbar now handles application switching and launching. It also groups multiple windows of a program together under one icon, as seen in the screenshot below where two explorer windows are open. If you’re not an uber-nerd like myself and are hearing about this for the first time, you can read this brief overview of the taskbar’s new features.
My Two Issues
While the new taskbar is almost perfect, it’s inflexibility in a couple of areas really frustrated me.
First, I hate, and I mean hate the fact that when multiple windows of an application are open, clicking on the program icon pops up the thumbnail previews instead of restoring the last active window. I’m such an OCD multi-tasker that I could not get used to having to decide which window it was that I was working with. I also hate that it now takes two clicks to restore a minimized window instead of one. The inability to change this is all the more insulting since you can just hover over an icon and see the thumbnails when you need them. So why must clicking on the icon also show the thumbnails if I don’t want it to?
The second issue is simple enough. If you middle click on an icon, it opens a new window of that program. But you can already open new instances by holding down shift and left clicking. I wanted to middle click on an icon and close all of its windows, similar to how Firefox closes tabs if you middle click on them.
Taskbar Overlord – an AutoHotkey Solution
So I’ve written a little AutoHotkey script that takes care of this problem. Clicking on an icon restores the last used window and middle clicking an icon closes all windows. I’ve dubbed this program Taskbar Overlord.
The road to paradise is filled with potholes
I’ll link to the download in just a moment, but first I need to explain some stuff. It turns out that I ran into a little trouble when I built this script, and it all has to do with how Windows protects certain programs that run with admin level privileges. In a nutshell, if you have a program that’s running with normal rights (such as an autohotkey script), Windows won’t let it interact with a program that’s running with admin level rights.
Why does this matter?
Well, if you don’t run anything with admin level rights, then this academic discussion doesn’t matter. However, lots of applications require admin rights. For example – regedit, the resource monitor, etc, etc. And what I quickly discovered was that Taskbar Overlord simply stops working when trying to interact with an admin level program. Kind of defeats the purpose.
Any program that’s an overlord needs admin level rights
The solution is to compile the AHK script as an .exe, and then launch it automatically when you log into Windows in such a way that you never get prompted to give it administrative rights. After all, it’s an overlord. It shouldn’t have to ask for your permission all the time.
The How-to-Geek has a great writeup on running a program with admin level rights automatically with the task scheduler when you log on to Windows. So if you run admin level programs, I recommend this.
Since publishing Taskbar Overlord, I’ve learned one more thing. When you launch tasks via the task scheduler, they run with a lower than normal priority. This means when things get busy on your computer, Taskbar Overlord doesn’t demand resources and is too willing to share.
It’s very easy to fix, if a little convoluted. A google search produced the following, which is the only way I’ve discovered to to elevated a task’s priority.
What I did to adjust the priorities was to export the task from Task Scheduler. Then edit the .xml file with notepad and change the value under priority to what you want. 7 (below normal) is the default for the task scheduler, 6, 5 ,or 4 are levels of normal (see link below). Then save as a different name and then import to Task scheduler. You will then need to delete the original task.
So just export the task by right clicking on it in the Task Scheduler, save it to the desktop, right click on the .xml desktop file and choose Edit or Open with, and open it in Notepad, find the line that says <Priority>7</Priority> and change the number to the value desired. Then import it back into the Task Scheduler. I set the priority to 1, which is just below the highest possible level, and now Taskbar Overlord works reliably, even when the machine is under load.
Download Taskbar Overlord
Anticipating that not everyone wants the same thing, I’ve provided several versions of the program to download.
By downloading, you agree to the legal notice at the end of this document.
- Taskbar Overlord – Source Code. This includes both the left click and middle click functionality as an .ahk script file. If you want one and not the other, I’ll let you edit the file accordingly.
- Taskbar Overlord Executable – Left and Middle Click.
Has both features. Switches to the last active window when left clicking. Closes all windows when middle clicking.
- Taskbar Overlord Executable – Left Click Only.
One feature only. Switches to the last active window when left clicking.
- Taskbar Overlord Executable – Middle Click Only.
One feature only. Closes all windows when middle clicking.
What’s the Overlord’s Secret?
It aint exactly rocket science. For the left click, Taskbar Overlord simply sends a control click if you’re over the taskbar. If you’ve been following Windows 7, you may recall that control + left click on an icon will cycle through the windows of a given program. Works great.
And for middle clicking, well it’s only slightly more complicated. The program sends shift + right click, and then types ‘c’ (for close all windows).
If future releases or bug fixes are needed, the following feed will announce new releases. http://www.ocellated.com/tag/taskbar-overlord/feed/
This code is released under the Creative Commons 3.0 Attribution Non-Commercial Share Alike license. You can share the code and you can change the code if wish, but the license must remain in effect and you must attribute the original source. You cannot use the work for any commercial purpose.
While the code here has been tested repeatedly under different scenarios and is believed to work properly, by using it you agree to hold its maker harmless from any damages. This code is released WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.