 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Titan
Joined: 11 Aug 2004 Posts: 5068 Location: imaginationland
|
Posted: Mon May 01, 2006 12:27 pm Post subject: WinTrans - a window shading tool |
|
|
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 |
|
 |
badmojo
Joined: 11 Nov 2005 Posts: 143
|
|
| Back to top |
|
 |
Titan
Joined: 11 Aug 2004 Posts: 5068 Location: imaginationland
|
Posted: Tue May 02, 2006 4:37 pm Post subject: |
|
|
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 |
|
 |
Smurth
Joined: 13 Dec 2006 Posts: 11
|
Posted: Wed Dec 13, 2006 9:03 am Post subject: |
|
|
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 |
|
 |
Lollypop Guest
|
Posted: Fri Jan 05, 2007 7:48 pm Post subject: |
|
|
Hello,
I've just tried this code... and it looks great !!
But (there's always a B. ) , i get an error message with nptepad++ windows... : Yeah, it seems the "++" leads to it....
Anychance to improve it???
(In france we call it "S.A.V." !) |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|