AutoHotkey Community

It is currently May 25th, 2012, 9:22 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 29 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: here goes mine
PostPosted: April 20th, 2006, 10:08 am 
numberpad / set it to opaque, * set it to more & more transparent (beginning from 200/255). (i used + & -, but sometimes the window's transparency seems not able to be fetched)
Code:
#NumpadDiv::
   WinSet, Transparent, 255, A
Return

#NumpadMult::
   Gosub, WinGetTransparency
   If Transparency > 100
   {
      Transparency -= 30
      WinSet, Transparent, %Transparency%, A
   }
Return

WinGetTransparency:
   WinGet, Transparency, Transparent, A
   If Transparency =
      Transparency = 200
Return


Report this post
Top
  
Reply with quote  
 Post subject: Latest version!
PostPosted: June 3rd, 2006, 7:49 pm 
Offline

Joined: August 28th, 2004, 12:25 am
Posts: 30
Location: France
:arrow: The latest version is available here: Transparency.ahk


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 29th, 2007, 4:02 pm 
Offline

Joined: July 15th, 2006, 1:30 am
Posts: 48
Sorry but this script seems like an overkill for its task.

Why not set 2 hotkeys and do the job right away inside them?

Code:
; Set Transparency of Windows Up (Opaque)
^+WheelUp::
    WinID := WinExist("A")
    WinGet, Trans, Transparent, ahk_id %WinID%
   
    if(!Trans)
        Trans := 254
       
    if(Trans < 255)
        Trans := Trans + 5
       
    if(Trans >= 255)
        Trans := "Off"

    ToolTip, % "Transparency: " Trans
    SetTimer, ReSetToolTip, 1000
    WinSet, Transparent, %Trans%, ahk_id %WinID%
return

; Set Transparency of Windows Down (Transparent)
^+WheelDown::
    WinID := WinExist("A")
    WinGet, Trans, Transparent, ahk_id %WinID%
   
    if(!Trans)
        Trans := 254
   
    if(Trans > 30)
        Trans := Trans - 5
       
    if(Trans >= 255)
        Trans := "Off"
   
    ToolTip, % "Transparency: " Trans
    SetTimer, ReSetToolTip, 1000
    WinSet, Transparent, %Trans%, ahk_id %WinID%
return


Ok I know that this will not prevent transparency on the Program Manager or the Task Manager but it is rather simpler and straightforward.

Side note: Does anyone know why when transparency is set to anything but "Off" (via winset), the transparent window turns black for a moment when I restore it from minimized position? It is rather annoying, do you get that kind of behavior?

_________________
One hotkey to rule them all!


Report this post
Top
 Profile  
Reply with quote  
 Post subject: nice work.
PostPosted: November 12th, 2007, 9:57 am 
Took my a while to work it out. Did it on desktop then I thought you need a window open and it works :D But its laggy with a few windows open


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 13th, 2007, 12:53 am 
Offline

Joined: July 15th, 2006, 1:30 am
Posts: 48
Here is my finished version, safe, without duplications and I hope without unneeded tasks and fast too:

Code:
; Set Transparency of Windows
^+WheelUp:: SetTransparency(10)
^+WheelDown:: SetTransparency(-10)

SetTransparency(Alpha)
{
    WinGet, WinID, ID, A
    WinGetClass, WinClass, A
    WinGet, Trans, Transparent, ahk_id %WinID%
   
    ; Don't make Transparent those special Windows
    if(WinID = "" || WinClass = "Progman" || WinClass = "Shell_TrayWnd" || WinClass = "WorkerW" || WinClass = "MsgrIMEWindowClass")
        return
   
    ; Set Transparency On
    if(Trans = "")
        Trans := 250
   
    ; Set Transparency Level
    Trans := Trans + Alpha
    if(Trans < 30)
        Trans := 30
       
    if(Trans >= 255)
        Trans := "Off"
   
    ToolTip, % "Transparency: " Trans
    SetTimer, ReSetToolTip, 1000
    WinSet, Transparent, %Trans%, ahk_id %WinID%
}

; Clear the ToolTip
ReSetToolTip:
    ToolTip
    SetTimer, ReSetToolTip, Off
return

_________________
One hotkey to rule them all!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 16th, 2007, 7:08 pm 
Offline

Joined: October 27th, 2007, 11:47 pm
Posts: 39
Location: olney, maryland
hey this is an amazing program, i use it in school all the time. i also added a command that when u press windows key + h it changes the title. the opacity also goes down to 3.

Code:
#SingleInstance Force
#MaxThreadsPerHotkey 10

SetBatchLines, -1
AutoTrim, Off

AlphaIncrement = 8.5

Ctrl & MButton::
   GetKeyState, ShiftState, Shift
   If ShiftState = U
   {
      Return
   }
   Gosub, WinGetTransparency
   Gosub, WinSetTransparency
   Gosub, ShowTransparencyToolTip
Return

Ctrl & WheelDown::
   GetKeyState, ShiftState, Shift
   If ShiftState = U
   {
      Return
   }
   Gosub, WinGetTransparency
   Trans0 -= 11
   Gosub, WinSetTransparency
   Gosub, ShowTransparencyToolTip

Return

Ctrl & WheelUp::
   GetKeyState, ShiftState, Shift
   If ShiftState = U
   {
      Return
   }
   Gosub, WinGetTransparency
   Trans0 += 11
   Gosub, WinSetTransparency
   Gosub, ShowTransparencyToolTip
Return

WinGetTransparency:
   MouseGetPos, , , WindowID
   If Trans_%WindowID% =
   {
      Trans_%WindowID% = 100
   }
   StringTrimRight, Trans, Trans_%WindowID%, 0
   Trans0 = %Trans%
Return

WinSetTransparency:
   WinGetClass, WindowClass, ahk_id %WindowID%
   If WindowClass = Progman
   {
      Trans0 = 100
   }
   Else If Trans0 < 1
   {
      Trans0 = 3
   }
   Else If Trans0 > 100
   {
      Trans0 = 100
   }
   a = %Trans%
   b = %Trans0%
   Trans = %Trans0%
   Trans_%WindowID% = %Trans%
   If WindowClass = Progman
   {
      Return
   }
   a *= 2.55
   Alpha0 = %a%            ; Starting Alpha
   b *= 2.55
   Alpha = %b%
   Transform, Alpha, Round, %Alpha%   ; Ending Alpha
   c = %Alpha0%            ; Init iteration var.
   d = %Alpha%
   d -= %Alpha0%         ; Range to iterate
   Transform, e, Abs, %d%
   If e > 0
   {
      f = %d%
      f /= %e%            ; Unity increment (+/- 1)
   }
   Else
   {
      f = 0
   }
   g = %f%
   g *= %AlphaIncrement%      ; Increment
   Loop
   {
      Transform, c, Round, %c%
      WinSet, Trans, %c%, ahk_id %WindowID%
      If c = %Alpha%
      {
         Break
      }
      Else If e >= %AlphaIncrement%
      {
         c += %g%
         e -= %AlphaIncrement%
      }
      Else
      {
         c = %Alpha%
      }
   }
Return

ShowTransparencyToolTip:
   h = %Trans%
   h /= 4
   i = 25
   i -= %h%
   ToolTipText = Opacity :%A_Space%
   Loop, %h%
   {
      ToolTipText = %ToolTipText%|
   }
   If h > 0
   {
      ToolTipText = %ToolTipText%%A_Space%
   }
   ToolTipText = %ToolTipText%%Trans%`%
   If i > 0
   {
      ToolTipText = %ToolTipText%%A_Space%
   }
   Loop, %i%
   {
      ToolTipText = %ToolTipText%|
   }
   ToolTip, %TooltipText%
   MouseGetPos, MouseX0, MouseY0
   SetTimer, RemoveToolTip
Return

RemoveToolTip:
   If A_TimeIdle < 1000
   {
      MouseGetPos, MouseX, MouseY
      If MouseX = %MouseX0%
      {
         If MouseY = %MouseY0%
         {
            Return
         }
      }
   }
   SetTimer, RemoveToolTip, Off
   ToolTip
Return

#h::
WinExist("A") ; Set the "last found window" to the current active window
WinSetTitle, College Search - SAT Reg... ; set the title to "College Search - SAT Reg"
return
#numpad9::exitapp

_________________
ehh... ill draw a pic of a charmander later


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 18th, 2007, 3:05 am 
Works great, but I somehow managed to change the opacity of my desktop, and it won't go back, looks better though :lol:


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 18th, 2007, 5:54 am 
Offline

Joined: October 27th, 2007, 11:47 pm
Posts: 39
Location: olney, maryland
ph34r wrote:
Works great, but I somehow managed to change the opacity of my desktop, and it won't go back, looks better though :lol:


haha yea, i had that problem too, i had no idea how i did the desktop tho

_________________
ehh... ill draw a pic of a charmander later


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 18th, 2007, 11:10 pm 
Offline

Joined: April 18th, 2007, 9:03 am
Posts: 127
i thing that it whuld be better if the icon menu shuld have a:

"set all windows to 100%" button

and a own exit button that will make all windows go back to 100% wen you exit app.

(it whuld solve the problem when you can´t get the windows back
and if you by accident in some how would not get the taskbar back you could add a keyword to exit app.)

and meaby a "only exit witout transper"




i am just come up with idéas. I am not that good in ahk so i can do it by my own. but i like the script very very much

i just came up with a another idea...
if you whuld right click on a windows in the taskbar (with ctrl+shift or i dont know) you could choose transpear stright. this whould alsow solve the problem of when you cant get the windows back.

i dont know what is possible to do whit ahk. meaby everything is possible if you are good on it.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 22nd, 2007, 12:20 am 
Offline

Joined: November 21st, 2007, 10:27 pm
Posts: 239
Location: 0x01101110
How long did it take you to make that. It works great!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 24th, 2008, 5:43 pm 
i built a little variation:

Code:
#SingleInstance Force
#MaxThreadsPerHotkey 10

SetBatchLines, -1
AutoTrim, Off

AlphaIncrement = 8.5

Ctrl & MButton::
   GetKeyState, ShiftState, Shift
   If ShiftState = U
   {
      Return
   }
   Gosub, WinGetTransparency
   Gosub, WinSetTransparency
   Gosub, ShowTransparencyToolTip
Return

Ctrl & WheelDown::
   GetKeyState, ShiftState, Shift
   If ShiftState = U
   {
      Return
   }
   Gosub, WinGetTransparency
   If Trans0 <= 10
   {
      Trans0 -= 2
   }
   Else
   {
      Trans0 -= 10
   }
   Gosub, WinSetTransparency
   Gosub, ShowTransparencyToolTip
Return

Ctrl & WheelUp::
   GetKeyState, ShiftState, Shift
   If ShiftState = U
   {
      Return
   }
   Gosub, WinGetTransparency
   If Trans0 <= 10
   {
      Trans0 += 2
   }
   Else
   {
      Trans0 += 10
   }
   Gosub, WinSetTransparency
   Gosub, ShowTransparencyToolTip
Return

WinGetTransparency:
   MouseGetPos, , , WindowID
   If Trans_%WindowID% =
   {
      Trans_%WindowID% = 100
   }
   StringTrimRight, Trans, Trans_%WindowID%, 0
   Trans0 = %Trans%
Return

WinSetTransparency:
   WinGetClass, WindowClass, ahk_id %WindowID%
   If WindowClass = Progman
   {
      Trans0 = 100
   }
   Else If Trans0 < 2
   {
      Trans0 = 2
   }
   Else If Trans0 > 100
   {
      Trans0 = 100
   }
   a = %Trans%
   b = %Trans0%
   Trans = %Trans0%
   Trans_%WindowID% = %Trans%
   If WindowClass = Progman
   {
      Return
   }
   a *= 2.55
   Alpha0 = %a%            ; Starting Alpha
   b *= 2.55
   Alpha = %b%
   Transform, Alpha, Round, %Alpha%   ; Ending Alpha
   c = %Alpha0%            ; Init iteration var.
   d = %Alpha%
   d -= %Alpha0%         ; Range to iterate
   Transform, e, Abs, %d%
   If e > 0
   {
      f = %d%
      f /= %e%            ; Unity increment (+/- 1)
   }
   Else
   {
      f = 0
   }
   g = %f%
   g *= %AlphaIncrement%      ; Increment
   Loop
   {
      Transform, c, Round, %c%
      WinSet, Trans, %c%, ahk_id %WindowID%
      If c = %Alpha%
      {
         Break
      }
      Else If e >= %AlphaIncrement%
      {
         c += %g%
         e -= %AlphaIncrement%
      }
      Else
      {
         c = %Alpha%
      }
   }
Return

ShowTransparencyToolTip:
   h = %Trans%
   h /= 4
   i = 25
   i -= %h%
   ToolTipText = Opacity :%A_Space%
   Loop, %h%
   {
      ToolTipText = %ToolTipText%|
   }
   If h > 0
   {
      ToolTipText = %ToolTipText%%A_Space%
   }
   ToolTipText = %ToolTipText%%Trans%`%
   If i > 0
   {
      ToolTipText = %ToolTipText%%A_Space%
   }
   Loop, %i%
   {
      ToolTipText = %ToolTipText%|
   }
   ToolTip, %TooltipText%
   MouseGetPos, MouseX0, MouseY0
   SetTimer, RemoveToolTip
Return

RemoveToolTip:
   If A_TimeIdle < 1000
   {
      MouseGetPos, MouseX, MouseY
      If MouseX = %MouseX0%
      {
         If MouseY = %MouseY0%
         {
            Return
         }
      }
   }
   SetTimer, RemoveToolTip, Off
   ToolTip
Return


makes the end nicer.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 21st, 2008, 7:18 pm 
This works perfectly for me. I shoved the ahk script into my startup folder and it's just one more feature of XP now. I did notice however when I compiled it, it wouldn't work. So for the guys who says it's not working try to not compile it. Other than that GREAT JOB!!!


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: May 30th, 2008, 1:57 pm 
Offline

Joined: April 11th, 2008, 3:55 pm
Posts: 5
Is there a way to make the transparency work with a firefox tool bar? This works perfectly for my actual browser window, but the transparency does not apply to my Roboform tool bar. I would like to be able to make this blend in as well.

Any suggestions?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 2nd, 2008, 8:54 am 
Offline

Joined: April 10th, 2008, 10:08 pm
Posts: 111
Wow. That's pretty cool. It didn't even cross my mind to use the mouse wheel, but I wrote something similar:
Code:
; this small section at beginning of the script
BarTransparency := 200
WienerTransparency := 255
; -----


; TASKBAR TRANSPARENCY!!!
Numpad0 & Down::
BarTransparency -= 50
if ( BarTransparency < 0 ) {
BarTransparency := 0
}
WinSet, Transparent, %BarTransparency%, ahk_class Shell_TrayWnd
return

Numpad0 & Up::
BarTransparency += 50
if ( BarTransparency >= 250 ) {
BarTransparency := 255
WinSet, Transparent, 255, ahk_class Shell_TrayWnd
WinSet, Transparent, Off, ahk_class Shell_TrayWnd
}
else {
WinSet, Transparent, %BarTransparency%, ahk_class Shell_TrayWnd
}
return

; GUI TRANSPARENCY!!!
Numpad0 & Left::
WienerTransparency -= 50
if ( WienerTransparency < 0 ) {
WienerTransparency := 0
}
WinGetActiveStats, Title, Width, Height, X, Y
WinSet, Transparent, %WienerTransparency%, %Title%
return

Numpad0 & Right::
WienerTransparency += 50
if ( WienerTransparency >= 250 ) {
WienerTransparency := 255
WinGetActiveStats, Title, Width, Height, X, Y
WinSet, Transparent, 255, %Title%
WinSet, Transparent, Off, %Title%
}
else {
WinGetActiveStats, Title, Width, Height, X, Y
WinSet, Transparent, %WienerTransparency%, %Title%
}
return

lol, sorry about the silly variable name. Don't know what I was smoking when I wrote that. :roll:

_________________
I slit the sheet, the sheet I slit,
and on the slitted sheet I sit. ;~}


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 29 posts ]  Go to page Previous  1, 2

All times are UTC [ DST ]


Who is online

Users browsing this forum: reesd, RoAltmann and 27 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group