AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

WinTrans - a window shading tool

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
Titan



Joined: 11 Aug 2004
Posts: 5068
Location: imaginationland

PostPosted: Mon May 01, 2006 12:27 pm    Post subject: WinTrans - a window shading tool Reply with quote

This is my version of the other window shading scripts. The script darkens all windows except the active one to help you focus on it better. It automatically adjusts when new windows are activated or closed, without any flickering.

Download (1kb)
_________________

RegExReplace("irc.freenode.net/ahk", "^(?=(.(?=[\0-r\[]*((?<=\.).))))(?:[c-\x73]{2,8}(\S))+((2)|\b[^\2-]){2}\D++$", "$u3$1$3$4$2")
Back to top
View user's profile Send private message Visit poster's website
badmojo



Joined: 11 Nov 2005
Posts: 143

PostPosted: Tue May 02, 2006 3:53 am    Post subject: Reply with quote

sounds similar to Skrommel's Ghoster...

Source: http://www.donationcoder.com/Forums/bb/index.php?topic=326.0
Back to top
View user's profile Send private message
Titan



Joined: 11 Aug 2004
Posts: 5068
Location: imaginationland

PostPosted: Tue May 02, 2006 4:37 pm    Post subject: Reply with quote

I wasn't the first one to come up with the idea, it's just my version.
_________________

RegExReplace("irc.freenode.net/ahk", "^(?=(.(?=[\0-r\[]*((?<=\.).))))(?:[c-\x73]{2,8}(\S))+((2)|\b[^\2-]){2}\D++$", "$u3$1$3$4$2")
Back to top
View user's profile Send private message Visit poster's website
Smurth



Joined: 13 Dec 2006
Posts: 11

PostPosted: Wed Dec 13, 2006 9:03 am    Post subject: Reply with quote

I've modified your script to allow window excluding.
Simply define some variables for each window_class or process_name (without the .exe) that need not to proceed. Spaces ( ) and dot (.) in these variable should be replace by an underscore (_)

Code:
#NoEnv
#Persistent

; alpha transparency of inactive windows
   alpha = 128

; Excluded windows
   #32770 = true
   Internet_Explorer_TridentDlgFrame = true
   litestep = true



Menu, Tray, NoStandard
Menu, Tray, Add, Alpha ON, alphaON
Menu, Tray, Add, Alpha OFF, alphaOFF
Menu, Tray, Add, Exit, exit

SetWinDelay -1
Gosub, alphaON
OnExit, exit



alpha_on(){

   Global

   WinGet, win_all, List
   Loop, %win_all%
   {
      WinGetClass, class, % "ahk_id" . win_all%A_index%
      WinGet, process, ProcessName, % "ahk_id" . win_all%A_index%

      StringTrimRight, process, process, 4
      StringReplace, process, process, ., _, All

      StringReplace, class, class, %A_SPACE%, _, All
      StringReplace, class, class, ., _, All

      if NOT ( %process% OR %class% )
         WinSet Transparent, %alpha%, % "ahk_id" . win_all%A_index%
   }
}



alpha_off(){

   WinGet, win_all, List
   Loop, %win_all%
      WinSet, Transparent, OFF, % "ahk_id" . win_all%A_index%

}



toggle_alpha:

hwnd := WinActive("A")
If  hwnd <> %hwnd_last%
{
   WinGetClass, class
   WinGet, process, ProcessName

   StringTrimRight, process, process, 4
   StringReplace, process, process, ., _, All

   StringReplace, class, class, %A_SPACE%, _, All
   StringReplace, class, class, ., _, All

   if NOT ( %process% OR %class% )
   {
      WinSet Transparent, OFF, ahk_id %hwnd%
      WinSet Transparent, %alpha%, ahk_id %hwnd_last%
      hwnd_last = %hwnd%
   }
}

Return



alphaON:

   alpha_on()
   SetTimer, toggle_alpha, ON

Return



alphaOFF:

   hwnd_last := WinActive("A")
   SetTimer, toggle_alpha, OFF
   alpha_off()

Return



exit:
alpha_off()
ExitApp

Back to top
View user's profile Send private message
Lollypop
Guest





PostPosted: Fri Jan 05, 2007 7:48 pm    Post subject: Reply with quote

Hello,

I've just tried this code... and it looks great !!

But (there's always a B. Wink ) , i get an error message with nptepad++ windows... : Yeah, it seems the "++" leads to it....

Anychance to improve it??? Cool
(In france we call it "S.A.V." !)
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group