Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

ALT-TAB replacement with icons and window titles in ListView


  • Please log in to reply
172 replies to this topic
evl
  • Members
  • 1237 posts
  • Last active: Oct 20 2010 11:41 AM
  • Joined: 24 Aug 2005
Updated: 13-04-08

As the title says, it's an Alt-Tab replacement that makes use of a Listview to display running programs along with their window icons (many thanks to shimanov for figuring out how to retrieve the icons!).

See my latest post(s) for replies to comments, etc.

I've uploaded the script to AutoHotkey.net as it's getting too long for a forum post ;-)

<!-- m -->https://ahknet.autoh...tTab/AltTab.ahk<!-- m -->

Latest changes:

LATEST VERSION CHANGES:

Since 21-03-08:
FIX: Some windows weren't shown in the list.

Since 19-03-08:
FIX: Group/tab related bugs

Since 25-04-06:
+: Groups of windows are shown in tabs - they can be re-arranged by drag-and-drop.
+: Settings tab.
+ & FIX: Updates to the listview colour code - much smoother now (thanks to ambi for updating the Listview script).
+ & FIX: Sorting of columns with direction indication ([+] or [-])
+: Mouse wheel over the TASKBAR scrolls the list - Middle button SELECTS a window in this mode (it normally CLOSES a window!).
+: Save data on big changes (in addition to program exit) - e.g. new group created, hotkeys changed
CHANGE: Selections with the mouse are now made with a double click (or just release the Alt key) instead of a single one.
CHANGE: Adjusted display position to be centered by default.
CHANGE: Dialog windows only indicated by red higlight (not by title too).
CHANGE: Not Responding windows indicated in a new column (not by title).
CHANGE: Many speed optimisations and code improvements (it's almost decipherable now ;-))
FIX: Handling of "Not Responding" windows with no delays.


Posted Image

Posted Image

evl
  • Members
  • 1237 posts
  • Last active: Oct 20 2010 11:41 AM
  • Joined: 24 Aug 2005
I'll leave a copy of the original script here in case others want to modify the basic functionality before the script gets too long to follow easily:

Now uploaded to AutoHotkey.net:

<!-- m -->https://ahknet.autoh... ... ersion.ahk<!-- m -->

shimanov
  • Members
  • 610 posts
  • Last active: Jul 18 2006 08:35 PM
  • Joined: 25 Sep 2005
Nice work.

It is a good start to what could become a full featured process/window manager.

A couple of suggestions:

1. Remove the spaces preceding the Control Panel applets' (CPA) window titles. They don't provide sufficient information. If you want to distinguish those windows from the rest, consider: [CPA] Date and Time Properties, [Control Panel] Date and Time Properties, [DIALOG] Date and Time Properties, etc; or add another column to identify the special nature of a particular window.

2. Replace the awful generic Control Panel icon. To retrieve icons for a CPA try the following:

(tested with Windows XP SP2)

further testing required to ensure universality


hps
  • Members
  • 14 posts
  • Last active: Nov 07 2007 06:34 PM
  • Joined: 19 Aug 2005
@evl

Great. I have written a tiny windows switcher with a listview. But without icons it is a little bit depressing.

How about:

while pressing ALT, enter the first character of a window to select it ?

multi monitor support, e.g. while pressing ALT press 1 for monitor 1,
2 for monitor 2.see my post http://www.autohotke...6064&highlight=
and shimanovs answer.

evl
  • Members
  • 1237 posts
  • Last active: Oct 20 2010 11:41 AM
  • Joined: 24 Aug 2005
Posted a new version at the beginning of the thread. Quite a few changes.


LATEST VERSION CHANGES:
20-11-05
Changed to activating the PID so that the topmost window is activated (e.g. save dialog)
Compare windows to pid of explorer.exe and include window if same - for shortcut icon changing, etc
Icons for control panel applets (CPA) - credit to shimanov!
Changed default icon for window not found
Check if more than 1 pid in alt-tab list then use ahk_id instead of PID for activating
Limit gui size when too many windows to fit on screen, A_ScreenHeight*0.8


@ shimanov:
Implemented both your changes. Big thanks for the control panel icons - would have taken me days :lol: Prefixed the "DIALOG" bit with a / and some spaces so they still stand out and the / for the first letter selection suggestion from

@ hps:
Keeping the Alt key pressed and pressing the first letter of the window name is implemented now. Without a tiny bit of modification it will only work for characters A-Z, 0-9 and / (since the alt key is held down, it actually sends modified ascii codes which had to be taken into account - e.g. captial letters).
I don't have a multimonitor setup myself so wouldn't really be able to test it out - and I wouldn't punish this forum with code I wrote and hadn't tested :wink:


I'm probably not doing the checks for which windows/dialogs to exclude/activate (by PID/ID) and the ownership of windows (seem to have got DllCall("GetParent"...) to work for dialog windows) in the best way but it should work for most stuff - so until I have a better idea or someone suggest a good way of finding out how windows are owned/topmost child, it'll have to do, which is sufficient right now I believe.

Also, any suggestions on how to reduce memory usage are welcome, as windows task manager says it's using just under 5 mb (I know it's not particularly reliable at reporting memory usage). I think I'm destroying the gui, listview and iconlist correctly.

Laszlo
  • Moderators
  • 4713 posts
  • Last active: Mar 31 2012 03:17 AM
  • Joined: 14 Feb 2005
Nice work! However, could you make a few simple changes?
- The tiny icons are too small on my highres screen. I would need a switch or something to be able to show larger ones.
- The last row of the list is not visible, the second last one is only partially visible on my monitor.
- Could you add a code section for the configuration/location/size/color etc. settings in the beginning of the script? It is much easier to change something there than searching inside the code, and making incompatible changes.

  • Guests
  • Last active:
  • Joined: --
@ Laszlo: Thanks for the comments.
- The original of shimanov's work had big icons so I've quite easily added those back and just finalising the layout of things now. I might also add an option to automatically switch to small icons if there are too many big icons to fit on the screen.
- Not 100% sure why the last row wasn't visible for you but I've added an extra pixel to the height and in teh next version you'll be able to easily modify the height so you could tweak it and let me know your results if it still does it.
- I'd been planning to add some user configurable options at the top and now seemed like the right time so they're going in there, although I also plan eventually to add in a proper configuration window for changing settings more easily.

evl
  • Members
  • 1237 posts
  • Last active: Oct 20 2010 11:41 AM
  • Joined: 24 Aug 2005
Posted a new version at the beginning of the thread. Quite a few changes again.

LATEST VERSION CHANGES:
> 21-11-05
"USER EDITABLE SETTINGS" section for easy customisation
Choice of large or small icons (see "USER EDITABLE SETTINGS" section)
Mouse wheel switching while displaying list
Large re-structure of code to allow for more automatic sizing of the listview/gui
Several small fixes.

jOc
  • Members
  • 7 posts
  • Last active: Oct 28 2007 05:58 PM
  • Joined: 07 Dec 2005
Nice :D

As I already posted in 320MPH - Ultra Fast Anything-Launcher (http://www.autohotke...er=asc&start=75)...
I have a feature wish list - to include a search for tasks to switch to (in the way Rajat handels that)... Would come pretty handy if you have a mess full of active tasks and you would like to switch by typing some characters from its name and sitch by confirming with enter.
Possibility to exclude some tasks, that you don't want to see there, would be also welcomed...
Regards,
jOc

Terrapin
  • Members
  • 107 posts
  • Last active: Feb 06 2007 03:38 PM
  • Joined: 15 Aug 2005
Evl, I just wanted to comment that this is very impressive! Both in the coding and in the look and function.

Best,

Bob
When it comes to Binary, there are 10 types of people. Those who get it and those who don't. :)

evl
  • Members
  • 1237 posts
  • Last active: Oct 20 2010 11:41 AM
  • Joined: 24 Aug 2005
@ jOc: Already added into the version I'm currently working on, the ability to cycle through windows in the list when pressing the first letter of the title (while the alt key is still held down from the initial press of Alt-Tab). I think typing more letters is probably unnecessary for the majority of users, however I might add a method for filtering if I can re-work my code to allow for manipulating the list order (e.g. exclude windows, group windows, etc).

@ Terrapin: Thanks for the kind words. I've replied to your PM too.

marqis
  • Guests
  • Last active:
  • Joined: --
Very nice... Thanks for sharing.

evl
  • Members
  • 1237 posts
  • Last active: Oct 20 2010 11:41 AM
  • Joined: 24 Aug 2005
Posted a new version (and updated the first 2 posts with the AutoHotkey.net links):

<!-- m -->https://ahknet.autoh...tTab/ALtTab.ahk<!-- m -->

Here are the changes (quite a lot of them, I'm much happier with it now, also added a fun feature to dock windows to the edges of the screen and have them autohide - available through the context menu, which detects which entry was right-clicked on):

LATEST VERSION CHANGES:
> 24-12-05
Edge-docking - dock windows to the edges of the screen and have them auto-hide (like the taskbar can)
Ability to exclude certain windows from alt-tab list (right-click menu)
Basic hotkey support for switching to specific windows (using window groups and adding window classes) (right-click menu)
Much more reliable handling of dialog windows by excluding ws_disabled ones
Activating by ahk_id again (due to change listed above)
Automatically switch to small icons if there are too many big icons to fit on the screen
Checks for alt key state to catch quick press and release
Doesn't display alt-tab list if alt key already released (due to change listed above)
Y-axis positioning - center or start at specified position and size downward, then up to max height (if necessary)
Generic icon for windows that don't return an icon due to being crashed/suspended
Type first letter of a program to cycle through them while still holding Alt.



not-logged-in-daonlyfreez
  • Guests
  • Last active:
  • Joined: --
Very nice! 8)

Two things:

- It doesn't resize with large icons...
- Could you add the option to add a "Show Desktop" in the list (Hide all windows, activate the desktop, like the icon in the Quick Launch bar)? That would be a great enhancement!

evl
  • Members
  • 1237 posts
  • Last active: Oct 20 2010 11:41 AM
  • Joined: 24 Aug 2005
EDIT for paragraph below: About resizing, I think I see what you mean now - there is too much blank space at the bottom of the listview? Not sure why it does it on another computer I just tried it on, but works fine on mine - think it must be to do with windows font sizes as mine are rather customised - I'll look into it and see if I can find a better way of determining the correct height of each row in the listview to calculate the gui height.
(Think I got this now: Could you explain "doesn't resize with large icons..."? I presume you haven't modified the code at all? The default is for using large icons and it should automatically switch to using small icons when it takes up too much of the screen. The Alt-Tab list should be automatically sized vertically to display all the items without a scrollbar being visible.)

I kind of doubt I'd add an entry for the desktop unless other people want it too - it's not something I think would be worth possibly interfering with the order of windows when there are already the windows shortcuts Win+D or Win+M and Win+Shift+M.

Thanks for the feedback.