Jump to content


Recommended Posts



- Task switcher

- Windows control

- Desktop manager

- and more

This is a tool I made a while ago using AutoHotkey with the main idea of -

Really fast window management without having to use the keyboard...

I selected the mouse hotkeys such that they won't interfere with any other program I know.

No installation needed - just unzip the folder anywhere you like and run the program...


Video preview:









1) 'Defocus'

Hover over a non-active window: all other windows on top become transparent, so you can see what's behind it (if 'Defocus'-option checked in Tray menu). Hovering over the desktop makes all windows transparent ('Autofocus'-option NOT checked - this is another mode)


The window you are hovering over is activated automatically instead and brought on top of all other windows ('Autofocus'-option checked - will automatically uncheck 'Defocus')

2) 'Show Desktop'

Left-clicking the Desktop will minimize all windows (if 'Show Desktop'-option is checked), clicking it again will restore the windows.


Alternatively the Desktop only can be shown ('Minimize mode' off) - makes a difference if e.g. using widgets, AveDesk, ... they are hidden then as well if not part of the Desktop ('sticked' to the Desktop like icons)

3) 'Expose all windows'

Show all windows in a dock at the top of your screen to select from by pressing the mouse wheel down(!) while turning it towards you (if 'Expose Windows'-option checked)

Minimized windows will be shown as well IF(!) they've been shown in the dock once before they've been minimized (see 'Important').

Hotkey sounds strange, but is easy to use and doesn't interfere with normal middle clicks for e.g. browsing. Just turn the wheel and press it down the same time.

Thanks to holomind/smurth, I modded their AHK Expose scripts.

4) 'Task Switcher'

Cycle through your windows (making them topmost and active) by holding the right mouse button down and turning the mouse wheel

5) 'Moving Windows'

Hold down Right and Middle Mouse button to move windows around the screen (similar to CTRL-Click on Linux) - they'll stick to the edge of your screen if you move the windows towards them. To unstick them, just let the buttons go, press them again and move the window away from the edge.

6) 'Resizing Windows'

If 'Resize Windows is checked in the tray menu, windows will be resized when sticking to an edge: When going on holding down Right and Middle Mouse button while the window is sticking, the window will be resized with your mouse movements. To stop resizing and unstick them, let go the buttons, press them again and move the window away from the screen's edge.

This may sound strange, but is a perfect way if you want to align a number of windows next to each other on the screen.

7) 'Maximize/Restore/Minimize Windows'

Press Left&Right Mouse button while moving upwards: Active window will be maximized.

Press Left&Right Mouse button while moving downwards:

Active, maximized window will be restored


Active, NOT maximized window will be minimized

8) 'Desktop Manager'

If Slide Windows is checked in the tray menu, windows will be slided to virtual desktops to the left or right (three virtual desks so far).

One starts on the middle desktop, to shift single windows from one desktop to another, just select them from the list of exposed windows and they slide to the desktop you are working at the moment. Minimized windows are not affected also from the sliding and will always stay/move onto the current desktop. The number of animation steps can be set in the ini-file - too many steps (smooth animation) however will affect the time it needs to switch desktops as all windows are shifted one after each other...

Press Left&Right Mouse button while moving left: Slide windows to the left = switch to the desktop to the right

Press Left&Right Mouse button while moving right: Slide windows to the right = switch to the desktop to the left

9) 'Jedi Focus'

If JediFocus is checked in the tray menu (not by default - edit settings for that), non-active windows will be shaded with only the active one 'sticking out'. This is a feature I think coming from Compiz, too (not sure so...) and makes it easier to concentrate on working with the active window.

10) 'Skin support'

Don't get excited - the only thing that needs to be skinning so far is the Overlay image shown when switching desktops...

If you want to skin that, all you have to do is create a new folder in the skins directory with new images and change the folder name to the new one in the ini-file.

Use 'magic pink' (FF00FF) for invisible parts.

11) 'Tray Icon'

A tray icon where you can switch on/of Autofocus and Show Desktop,etc., Pause or Exit the program or change the start-up settings (via editing the ini-file - it's commented)

12) 'Exclusion lists'

Probably an advanced feature to use, but makes Defocus quite adjustable -

Windows, that are added to one of the 3(!) exclusion lists (their EXACT window title) are excluded from the following actions:

- windows not to be focused at = windows that won't trigger any action when hovering with your mouse over it (menus, ...)

- windows not to be made transparent

- windows not 'exposed' in the upper dock for switching tasks


More to come:


- Options dialog

- Customizable Hotkeys (far in the future)




UPDATE 29.05.09 - Defocus 1.3.0


- NEW feature: Desktop Manager (skinable)

- NEW feature: Maximize/Restore/Minimize Windows

- NEW feature: Set Transparency of focused/active windows, too (by editing settings)

- NEW feature: Jedifocus

- NEW feature: Change sensibility of some Hotkeys by editing settings

- Added Option to disable 'Defocus' in Tray Menu - now both 'Autofocus' and 'Defocus' can be disabled

UPDATE 19.05.09 - Defocus 1.2.0


- NEW feature: Move windows easily

- NEW feature: Resize windows easily

UPDATE 30.04.09 - Defocus 1.1.0


- reduced CPU usage

- NEW feature: Fast task switching by holding your right mouse button and cycling your mouse wheel

- NEW feature: Expose all windows (see screenshot) by holding down the middle button (mouse wheel) and cycling your mouse wheel down once

(Sounds strange and needs getting used to, but is easy and fast, just make sure the mouse wheel is pressed down while turning it towards you).

- Choose if you want to show your Desktop instead of minimizing/restoring all windows by clicking on your desktop ('minimize mode')

- added new features to the menu

- should have less CPU usage when doing nothing...

- Now 3 exclusion lists to avoid problems with other programs (see 'important')

22.04.09 - Defocus 1.0.0


- Initial release




1) Having problems with some applications when changing their window transparency or 'exposing' them:

Just add their window titles to the exclusion lists ('edit settings') - that should solve 99% of all problems with inter-program compatibility.

If you don't know the exact window title, there is a tool at the Autohotkey website (AU3_Spy.exe or AHK_Window_Info) - if that's too complicated, please notify me. I'll look into it (if I got the program) and'll add the window titles to the exclusion lists of the next release.

For a tutorial how to use this tool, see here: http://www.aqua-soft.org/forum/index.php?showtopic=51906

2) Defocus should be compatible with XP and Vista (not tested), I am not much of a programmer, but AutoHotkey normally is very compatible, so it should be o.k.

3) To work with Windowblinds I had to exclude the window frames from the script - so you must hover over the window content, not its frames to 'focus' on it if you're using windowblinds - it's a problem with WB most window-operations have: The frames are not really associated with the rest of the window, at least with older versions of WB...

4) Exposing windows: On hotkey press, all open windows are captured (like a screenshot) and shown in the dock - minimized windows are shown as well, IF they've been captured once BEFORE (when they were still open). If no preview image for the minimized window is available, it will show up in the dock as an empty frame with the window title - you still can select it and the window will be restored). I deliberately kept this feature simple and didn't add any shell hooks controling minimize/restore actions for triggering a capture, as a program relying on that only gets into problems with other applications (Nvidia desktop manager is a pain, ...)

5) I'm planning to put some more work in this little tool and I still have more ideas for some interesting features, but as mentioned on my deviantArt page - I'm very busy right now it takes some time till I'm online again, so please don't get impatient...

Edited by mps69
Link to post

Hi there -


Thanks a lot for trying :D


Just add the Expose clone to the exclusion list (worked for me) -


- Right-click tray icon, select edit settings

- for DExpose: Add ",DExposE2 - Expose For Windows" (without the "") to the line

- for WinExpose should be similar, unfortunately WinExpose doesn't work for me at all (could be cause I was running Dexpot before, also I switched it of before running Expose...)

So the line would be:

NonFocus_list=,Program Manager,AveDesklet,AveLabel,AveCloseButton,Dexpot,RK Launcher,RocketDock,WinExposeWnd,DExposE2 - Expose For Windows

That should do the trick, at least if Defocus is set to 'Autofocus' - I'm already doing a new version, that should work with DExpose and Defocus set to making windows transparent (works for me already) -

but I'll wait with the release till I know more about other bugs as well.

What happened causing the bug:

WinExpose and DExpose open a new window top of all other windows where they show the minimized images - Defocus tries to focus on that window and changes transparencies.

So now I added a second exclusion list, I got one list for windows that should not be changed in transparency and one that lists windows not to be focused at...

What I could do:

Make the script pause everytime a certain key-combination is pressed - so it doesn't interfere with certain applications at all or enhance the exclusion lists etc. -

there are a lot of possibilities if I would know more about how the Expose clones work (what windows they create/activate/refresh...)

Link to post

I see lot's of incompatibilities between these customization apps, including my own apps (even between my own apps like AppleMinMax and WinExpose).

The real problem here is we don't have a desktop manager / compositor featureful enough to do all the work in compatibility with other apps.

If we take a look at Compiz-Fusion (a Linux desktop compositor) they have a plugin system. It would be really cool if someone did something like this (even without the plugins, we would write those). It looks far from possible but maybe it is not ;)

Link to post


Thanks a lot. I think my next version should use less CPU, although for me it didn't use a lot of CPU except for the moment of 'focusing'. But, well all PCs are different anyway, so it's difficult to tell what happens on a system...

So next version will only make windows on top of the focused one transparent (so less CPU), WinExpose and DExpose are added to the exclusion list and I'll add a query if windows are already transparent before setting their transparency (didn't do so before, cause I was unsure bout AHKscript speed and I wanted to make it as fast as possible).

What you can also try out, is choosing 'change settings' from the menu and raise the refresh time a bit, e.g. RefreshTime=200 - if CPU hit is high all the time.


I know what you mean, but (just guessing) if you're e.g. using some commands within gdi32.dll like CreateCompatibleDC, CreateCompatibleBitmap, BitBlt... to render images of the windows within another window laid on top I think there should be no problem if defocus doesn't 'touch' your rendering window, as it's actually only querying the mouse position to get the window beneath and then change transparencies of all (titled) windows not in the exclusion list. Well maybe there could be problems, if an Expose app wants to do an image a transparent window?

Then at least both programs should work together if Defocus is set to 'Autofocus'?! Not totally sure so...

Regarding Compiz - yeah, something like that would be great - give me 10 god-like programmers and I do it ;)

I actually have given this some thought (although I'm not a programmer myself, just a 'scripter', hehe), cause I think 'Desktop management' is heading a bit in the wrong way with most operating systems - there should be a real break, trying something really new instead of pimping up old ways. But although I got plenty of ideas, I'd never be able to do it, even if I would be good in programming...

Link to post

The problem is WinExposé cannot blit semi-transparent windows.

Well, I could blit semi-transparent windows, but normally they're Yahoo! Widgets, AveDesk desklets, etc... so I avoid them like the plague :P

If I had some way to know those semi-transparent windows should be "exposé-ed", I would of course.

You'll notice your program probably doesn't have problems with Insentinet's Switcher under a Vista + Aero setup. This is because Switcher uses Vista's window composition engine instead of doing hard hacks like WinExposé (indeed I consider Switcher good enough to not write a version of WinExposé for Vista + Aero setups, limiting my program to 2000 / XP setups).

Maybe I'll add an inclusion list instead, at some point, where you must specify each app which will be exposed, independently their windows being semi-transparent, layered, per-pixel alpha transparents, or whatever (and maybe... just maybe... out of the box compatibility with Apple Min/Max, TrueTransparency and WindowBlind's per pixel alpha skin borders).

As with everything else, I lack of enough time.

BTW 10 god-like programmers would be very good idea, may I suggest John Carmack? Does anyone know how to contact him? :) (ok ok just kidding hahaha)

Link to post

UPDATED to version 1.1.0 - see first post


Well, I'm afraid I cannot blit semi-transparent windows, too -

at least they get messed up if their transparancy is changed by AHK...

I'm still refusing to use Vista, so I can't test this one - but I added a task switcher myself with the new version, so there's an alternative at least.

I was more thinking bout Johnny Chung Lee - so we can get the hardware and gesture recogition support...

All you have to do then is implanting an IR-LED somewhere near your face!


If you discover problems with programs when their transparency is changed, they are focused at etc., just report them here (and maybe describe what's going wrong), so I can add them to the exclusion lists of the next version...

Edited by thewer
Link to post
  • 3 weeks later...

Great features, just playing around with this app.

Can you please describe the exclusion lists a bit? I'd like to add some programs to the not trigger anything list, but am not familiar with the 'AU3_Spy.exe or AHK_Window_Info'.

Link to post

NEW VERSION & FEATURES - Defocus 1.2.0

I'll try to make a video of the features soon and upload it via youtube, think this would be the best manual.


Hi there -

Yep, you're right, I should have explained this a little bit more. My fault, sorry - So here's the how to:

You'll best download Autohotkey ('AHK' - the program) and the AHK_Window_Info script (to run with the program.

1. Download either the AHK installer at http://www.autohotkey.com/download/AutoHotkeyInstall.exe

or - if you don't want to install anything -

the zip-file with the compressed program at http://www.autohotkey.com/download/AutoHotkey.zip

2. Install the downloaded program


Unzip the downloaded file to any location you like (e.g. C:\programs\AHK)

3. Download the AHK Window Info 1.7 script at http://www.autohotkey.net/~toralf/Window_I...w_Info_v1.7.ahk (rightclick this link and choose 'Save target as') or go to the website http://www.autohotkey.com/forum/topic8976.html and the same with the link called 'AHK Source Code'

4. If you installed AHK - doubleclick the downloaded 'AHK_Window_Info_v1.7.ahk' or - if not -

rightclick the 'AHK_Window_Info_v1.7.ahk' and choose 'Open with', then point to the unzipped Autohotkey.exe (e.g. at C:\programs\AHK)

A window will pop up looking like this AHK_Window_Info_v1.4_01.jpg

Click on any window (or hover over it) - the exact window title will be shown. Copy this title in the exclusion list you won't to adress (EXACT, no additional spaces) and you're done.

So for example, when I wanted to exclude RK Launcher from being made transparent I added following - a comma and directly after the exact Window title

BEFORE: Exclusion_list=,Program Manager,AveDesklet,AveLabel,AveCloseButton,Dexpot

AFTER: Exclusion_list=,Program Manager,AveDesklet,AveLabel,AveCloseButton,Dexpot,RK Launcher

Hope this is a little bit more clear now... :)

Link to post

Hi there -


Thanks a lot, but I of course have to admit that my work is based on the strong features of AHK - I only did bundle it in a (hopefully) neat package... :)


Much easier: If you don't want to use certain functions, just disable them via the Tray menu or by editing the settings. If disabled, the functions won't be triggered at all... :)

Link to post

Please sign in to comment

You will be able to leave a comment after signing in

Sign In Now
  • Create New...