AutoHotkey Community

It is currently May 26th, 2012, 11:52 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: August 19th, 2008, 7:15 pm 
Offline

Joined: June 5th, 2007, 10:57 pm
Posts: 89
Location: USA
This guy isn't complicated, just run it open a ton of windows, cascade and play around with alt tab and moving your mouse over windows.

All it does is make all windows transparent other than the active window. It also partially fades in windows when your mouse moves over it.

Also pressing control + alt + A makes toggles always on top for the window currently under the mouse.

Code:
#persistent

settimer, transman, 100
settimer, partunfade, 100
onexit, exiter
transstart()
return

^!a:: ;***
   mousegetpos,,,win
   wingettitle, title, ahk_id %win%
   winset, AlwaysOnTop,TOGGLE, ahk_id %Win%
   if instr(title, " - Always on top")
      winsettitle, ahk_id %win%,,% substr(title, 1, instr(title, " - Always on top") - 1)
   else winsettitle, ahk_id %win%,,%title% - Always on top
return ;*

transman: ;***
   makemtrans()
return ;*

partunfade: ;***
   makemabittrans()
return ;***

exiter: ;***
winget, allwindows, list
Loop, %allwindows% {
   win := allwindows%A_index%
   wingettitle, tit, ahk_id %win%
   wingetclass, cls, ahk_id %win%
   if a_index = 1
   wingettitle, activetit, A
   if isitlegal(cls) and !(tit = activetit) {
      winset, Transparent, OFF, ahk_id %win%
   }
}
exitapp
return ;*

;fix always on top mover
;fix for active windows that shouldn't change transparency eg (find dialogues)


transstart() {
   loop, 200
   {
      thistime := a_index
      winget, allwindows, list
      Loop, %allwindows% {
         win := allwindows%A_index%
         wingettitle, tit, ahk_id %win%
         wingetclass, cls, ahk_id %win%
         if a_index = 1
            wingettitle, activetit, A
         if isitlegal(cls) and !(tit = activetit)
            winset, Transparent,% 255 - thistime, ahk_id %win%
      }
   }
   oldwin := newwin
}

makemtrans() {
   static oldwin
   winget, newwin,, A
   if !(newwin = oldwin) {
      loop, 200
      {
         if a_index = 1
            wingetclass, cls, ahk_id %oldwin%
         if isitlegal(cls)
            winset, Transparent,% 255 - a_index, ahk_id %oldwin%
         if a_index = 1
            wingetclass, cls2, ahk_id %newwin%
         if isitlegal(cls2)
            winset, Transparent,% 55 + a_index, ahk_id %newwin%
      }
   }
   oldwin := newwin
}

makemabittrans() {
   static oldwin
   mousegetpos,,,newwin
   if !(newwin = oldwin) {
      loop, 150
      {
         if (a_index = 1) {
            wingetclass, cls, ahk_id %oldwin%
            winget,activewin,, A
         }
         if isitlegal(cls) and !(oldwin = activewin)
            winset, Transparent,% 205 - a_index, ahk_id %oldwin%
         if (a_index = 1) {
            wingetclass, cls2, ahk_id %newwin%
            winget,activewin2,, A
         }
         if isitlegal(cls2)  and !(newwin = activewin2)
            winset, Transparent,% 55 + a_index, ahk_id %newwin%
      }
   }
   oldwin := newwin
}

isitlegal(cls) {
   wingettitle, activetit, A
   return !(cls = "Button") and
      !(cls = "Progman") and
      !(cls = "SynTrackCursorWindowClass") and
      !(cls = "Shell_TrayWnd")
}
         



please give feedback for ideas for additional features or bug fixes.

SCREENSHOT


Last edited by philz on August 20th, 2008, 1:32 am, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 19th, 2008, 7:58 pm 
Use png/gif/jpg as format for a screenshot. Bmp isn't of any use if used online. :roll:


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: August 19th, 2008, 8:01 pm 
Use a less generic subject line/name for your script, like Transparatizer ... :wink:


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: August 19th, 2008, 8:57 pm 
Offline

Joined: July 21st, 2008, 4:16 pm
Posts: 726
Location: Calgary, AB, Canada
Actually pretty cool... I found that it kinda did it's fading a little too slowly, so I changed:

Code:
transstart() {
   loop, 40
   {
      thistime := a_index
      winget, allwindows, list
      Loop, %allwindows% {
         win := allwindows%A_index%
         wingettitle, tit, ahk_id %win%
         wingetclass, cls, ahk_id %win%
         if a_index = 1
            wingettitle, activetit, A
         if isitlegal(cls) and !(tit = activetit)
         {
            winset, Transparent,% 255 - (thistime * 5), ahk_id %win%
         }
      }
   }
   oldwin := newwin
}

makemtrans() {
   static oldwin
   winget, newwin,, A
   if !(newwin = oldwin) {
      loop, 40
      {
         if a_index = 1
            wingetclass, cls, ahk_id %oldwin%
         if isitlegal(cls)
            winset, Transparent,% 255 - (a_index * 5), ahk_id %oldwin%
         if a_index = 1
            wingetclass, cls2, ahk_id %newwin%
         if isitlegal(cls2)
            winset, Transparent,% 55 + (a_index * 5), ahk_id %newwin%
      }
   }
   oldwin := newwin
}

makemabittrans() {
   static oldwin
   mousegetpos,,,newwin
   if !(newwin = oldwin) {
      loop, 30
      {
         if (a_index = 1) {
            wingetclass, cls, ahk_id %oldwin%
            winget,activewin,, A
         }
         if isitlegal(cls) and !(oldwin = activewin)
            winset, Transparent,% 205 - (a_index * 5), ahk_id %oldwin%
         if (a_index = 1) {
            wingetclass, cls2, ahk_id %newwin%
            winget,activewin2,, A
         }
         if isitlegal(cls2)  and !(newwin = activewin2)
            winset, Transparent,% 55 + (a_index * 5), ahk_id %newwin%
      }
   }
   oldwin := newwin
}

Decreased the Loop Sizes.
It goes a little quicker... But it seems to sometimes have a problem distinguishing which application is currently the active one. It'll fade all applications, but allow you to type on the transparent active window. Not sure what causes it though.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 3rd, 2008, 3:17 am 
this is a pretty nifty script, thanks!

i guess the main problem i've run into is it makes menu in programs transparent, which makes them tough to use. For example, in Firefox, clicking "Bookmarks" gives me a semi-transparent menu, and so forth.

I see that you have space at the end of your script for exclusions? Maybe incorporate some kind of exclusion for menus?


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: IsNull, oldbrother, Rajat and 61 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