AutoHotkey Community

It is currently May 26th, 2012, 1:16 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Window Fader
PostPosted: November 22nd, 2008, 11:40 pm 
Offline

Joined: October 27th, 2007, 8:30 am
Posts: 21
Location: Hawaii
A simple slider bar, that attaches itself to the title bar of the window, drag the slider, and it will make the window its attached to transparent, still in beta, don't change the transparency of your desktop like a script kiddie please, it screws your icons, and wallpaper over, maybe for good, still haven't restarted.

Quite small too.

EDIT1:
Made the slider slightly transparent, as so it doesn't stick out on the blue bar.
Made it shrink, as the window shrinks, so it doesn't stick off the window when it gets to small.
Made it stick to the window when moved.

Code:
SetBatchLines, -1
SetTimer, Move, 10
SetTimer, Window, 1
Gui, Add, Slider, Range0-255 x0 y0 w230 h20 vFade gTrans, 255
Gui, +AlwaysOnTop +ToolWindow -Caption
Gui, Show, x521 y10 h16 w237, Fader
WinSet, Transparent, 150, Fader
Return

Move:
GuiControl, Move, Fade, x0 y0 w%WWidth% h20
Gui, Show, NoActivate x%WX% y%WY% h16 w%WWidth%
Return

Window:
WinGetActiveStats, Title, Width, Height, X, Y
If(Title == "Fader")
   Return
PastTitle := Title
WWidth := Width/6
WY := Y+10
WX := X+Width - 75 -WWidth
Return

Trans:
Gui, Submit, NoHide
ControlFocus, %PastTitle%
WinSet, Transparent, %Fade%, %PastTitle%
Return



Constructive criticism welcome.

_________________
Image
0100111001101001011000110110101101011011001101000011001000110000010011010110111101101110011001010111100101011101


Last edited by Nick[420Money] on November 23rd, 2008, 1:45 am, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 23rd, 2008, 12:43 am 
Offline

Joined: August 2nd, 2008, 12:31 am
Posts: 101
COOL! :D
it slows down window resizing, and window dragging tho.

_________________
Woot.

Please read forum etiquette


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 23rd, 2008, 12:45 am 
Offline

Joined: January 12th, 2008, 7:45 pm
Posts: 131
This is cool;

Hmm, well since this tool is focused on additional functions for windows, why not add a few other "common" controls, as roll up the window, minimize to tray etc.. but it's jsut a suggestion imho.

Didn't look through your code properly, but the Settimer could be a bit devastating if you're running the program in the background... I tend to code my scripts in such ways that they barely affect the pc (Only on scripts that are meant to run the whole time)...


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 23rd, 2008, 1:08 am 
Offline

Joined: October 27th, 2007, 8:30 am
Posts: 21
Location: Hawaii
Ice_Tea wrote:
Didn't look through your code properly, but the Settimer could be a bit devastating if you're running the program in the background... I tend to code my scripts in such ways that they barely affect the pc (Only on scripts that are meant to run the whole time)...


Bleh I know I couldn't find a way to get it to stay on the bar maybe ill set it to like 10Ms.
And yeah I was kinda thinking that like having a windows function script like, min2tray, roll up, and this all in one script but lets work the kinks out of this first.

And @ Jex thanks lol this is my first script actually Heh :roll:

Also my computer has dump truck loads of ram lol I think I have like 8 gigs or so of ram, so it doesn't affect me at all I may make a settings window for it, that would work.

_________________
Image
0100111001101001011000110110101101011011001101000011001000110000010011010110111101101110011001010111100101011101


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 23rd, 2008, 2:41 am 
Offline

Joined: October 27th, 2007, 8:30 am
Posts: 21
Location: Hawaii
Trying to find a way to tell when the user switches to a new window, so it can retrieve the attributes I need(Always On Top, Transparency Level, Ect.)
Any ideas?

_________________
Image
0100111001101001011000110110101101011011001101000011001000110000010011010110111101101110011001010111100101011101


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 23rd, 2008, 2:48 am 
Offline

Joined: April 18th, 2008, 7:57 am
Posts: 1390
Location: The Interwebs
Well, I posted some info here on a way to check for active window change, but its straight from MSDN and I have no idea how to use for AHK... unfortunately the thread has received no replies so it seems that no one else does, either ):


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 23rd, 2008, 7:38 am 
Offline

Joined: October 27th, 2007, 8:30 am
Posts: 21
Location: Hawaii
Added a button to make the current window always on top, but still no way to tell when the active window changes.

_________________
Image
0100111001101001011000110110101101011011001101000011001000110000010011010110111101101110011001010111100101011101


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 26th, 2008, 1:52 am 
Offline

Joined: December 16th, 2007, 12:55 pm
Posts: 48
You might want to look into ShellHook messages. I learned quite a lot from this script: http://www.autohotkey.com/forum/topic35623.html


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 26th, 2008, 2:06 am 
Offline

Joined: November 1st, 2007, 10:03 pm
Posts: 885
Super Small Change > Added AltSubmit so the window fades realtime

Code:
SetBatchLines, -1
SetTimer, Move, 10
SetTimer, Window, 1
Gui, Add, Slider, Range0-255 x0 y0 w230 h20 vFade gTrans, 255
Gui, +AlwaysOnTop +ToolWindow -Caption
Gui, Show, x521 y10 h16 w237, Fader
WinSet, Transparent, 150, Fader
Return

Move:
GuiControl, Move, Fade, x0 y0 w%WWidth% h20
Gui, Show, NoActivate x%WX% y%WY% h16 w%WWidth%
Return

Window:
WinGetActiveStats, Title, Width, Height, X, Y
If(Title == "Fader")
   Return
PastTitle := Title
WWidth := Width/6
WY := Y+10
WX := X+Width - 75 -WWidth
Return

Trans:
Gui, Submit, NoHide
ControlFocus, %PastTitle%
WinSet, Transparent, %Fade%, %PastTitle%
Return


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: IsNull and 18 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