Jump to content

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

DimInactive - Dim all inactive windows


  • Please log in to reply
4 replies to this topic
skrommel
  • Members
  • 193 posts
  • Last active: Jun 07 2010 08:30 AM
  • Joined: 30 Jul 2004
:D Here's a script to dim all inactive windows giving the active one full attention.

DimInactive creates a black gui with an emtpy image to catch any clicks, sets the transparency, puts it on top and alters the region to cover all the desktop except the active window.

It was asked for in a different forum by jsmallberry, so the idea is not mine.

@Chris: There's a limitation in the WinSet,Region that had me debugging for hours - it doesnt works with negative numbers. A bug or a feature? I can live with the workaround.

Skrommel


;DimInactive
;Dims inactive windows
;Skrommel 2005

Gui,+Owner +AlwaysOnTop -Disabled -SysMenu -Caption
Gui, Color, 000000 
Gui,Add,Picture,X0 Y0 W%A_ScreenWidth% H%A_ScreenHeight% gCLICK,
Gui,Show,NoActivate X0 Y0 W%A_ScreenWidth% H%A_ScreenHeight%,WINDOW
WinSet,Transparent,100,WINDOW

LOOP:
Sleep,0
WinGetActiveStats,wint,winw,winh,winx,winy
winw+=winx
winh+=winy
If winx<0
  winx=0
If winy<0
  winy=0
If wint=
{
  winx=0
  winy=0
  winw=%A_ScreenWidth%
  winh=%A_ScreenHeight%
}
WinSet,Region,0-0 %A_ScreenWidth%-0 %A_ScreenWidth%-%A_ScreenHeight% 0-%A_ScreenHeight% 0-0  %winx%-%winy% %winw%-%winy% %winw%-%winh% %winx%-%winh% %winx%-%winy%,WINDOW
WinSet,Top,,WINDOW  ; Rem this line to keep the task bar visible
Goto,LOOP

CLICK:
WinSet,Bottom,,WINDOW
CoordMode,Mouse,Screen
MouseGetPos,mousex,mousey,mousewin
MouseClick,Left,%mousex%,%mousey%
MouseClick,Left,%mousex%,%mousey%
WinSet,AlwaysOnTop,On,WINDOW
Return


polyethene
  • Members
  • 5519 posts
  • Last active: May 17 2015 06:39 AM
  • Joined: 26 Oct 2012
That's a really good idea, nice script.

Moving windows is laggy/slow and tooltips sometimes don't fully show. Other than that, it's great! Thanks.

garry
  • Spam Officer
  • 3219 posts
  • Last active: Sep 20 2018 02:47 PM
  • Joined: 19 Apr 2005
had problem with my eyes, had usually a grey or black background
now all the not active windows are dimmed
nice script

Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
that's one neat script here!

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat


skrommel
  • Members
  • 193 posts
  • Last active: Jun 07 2010 08:30 AM
  • Joined: 30 Jul 2004
:D A much improved version can be found here http://www.autohotke...opic.php?t=4535.

Skrommel