Jump to content

Vista only video transparency


er453r
 Share

Recommended Posts

And "Aero" theme only, since in Aero theme all windows are handled the same way, no matter the content (DirectX propably...)

Ok, so the idea for the script was simple - I wanted to write my code watching a movie. So why not make my editor transparent? So here it is. And it can even make transparent any visible window you want! Yay! :)

Again - this works only in Vista, and only in Aero theme. (checked it with XP but it doesn't bring the desired effect since videos and windows are drawn diffirently)

CODE

#include <GUIConstants.au3>
#include <GuiListView.au3>

Opt("WinTitleMatchMode", 2)
Opt("TrayIconHide",1)

GUICreate("Tran", 430, 203)
GUISetState()

$upd=GUICtrlCreateButton("update / reset", 10, 70, 90, 20)
$ext=GUICtrlCreateButton("exit", 10, 100, 90, 20)
$abt=GUICtrlCreateButton("?", 45, 130, 20, 20)
GUICtrlCreateLabel("Visible",103,14)
GUICtrlCreateLabel("Invisible",100,170)

$sli=GUICtrlCreateSlider(110,30,20,140,$TBS_VERT)
GUICtrlSetData(-1,0)
GUICtrlSetLimit(-1,255,0)

$list=GuiCtrlCreateListView("lol!",150,8,272,188)
_GUICtrlListViewSetView($list,$LV_VIEW_TILE)

global $lista, $prc[999], $hum=0, $last=0, $lasti=""

Func update()
    GUICtrlSetData($sli,0)
    _GUICtrlListViewDeleteAllItems($list)
    $lista=WinList()
    
    $objWMIService = ObjGet("winmgmts:\\localhost\root\CIMV2")
    $colItems=$objWMIService.InstancesOf("Win32_Process")
    If IsObj($colItems) then
       For $objItem In $colItems
            For $lol=1 To $lista[0][0] Step +1
                If $objItem.handle==WinGetProcess($lista[$lol][0]) AND $lista[$lol][0]<>"" AND BitAnd(WinGetState($lista[$lol][1]),2) AND NOT StringInStr($objItem.ExecutablePath,"explorer") Then
                    WinSetTrans($lista[$lol][0],"",255)
                    GuiCtrlCreateListViewItem($lista[$lol][0], $list)
                    GUICtrlSetImage(-1,$objItem.ExecutablePath,0)
                    $prc[$lol]=0
                    ExitLoop
                EndIf
            Next
        Next
    Endif
EndFunc

update()

Do
    Sleep(10)
    
    if GUICtrlRead($sli)<>$last AND $hum<>GUICtrlRead($sli) Then        
        For $lol=1 To $lista[0][0] Step +1
            If $lista[$lol][0]==GUICtrlRead(GUICtrlRead($list)) Then
                WinSetTrans(GUICtrlRead(GUICtrlRead($list)),"",255-GUICtrlRead($sli))
                $last=GUICtrlRead($sli)
                $prc[$lol]=GUICtrlRead($sli)
                ExitLoop
            EndIf
        Next
    EndIf
    
    if GUICtrlRead(GUICtrlRead($list))<>$lasti Then
        For $lol=1 To $lista[0][0] Step +1
            If $lista[$lol][0]==GUICtrlRead(GUICtrlRead($list)) Then
                GUICtrlSetData($sli,$prc[$lol])
                $lasti=GUICtrlRead(GUICtrlRead($list))
                $hum=$prc[$lol]
                ExitLoop
            EndIf
        Next
    EndIf
    
    $msg=GUIGetMsg()

    if $msg==$upd Then
        update()
    ElseIf $msg==$abt Then
        MsgBox(64,"Yeah!","Another great program"&@CRLF&@CRLF&"                          by"&@CRLF&"                                er453r")
    ElseIf $msg==$GUI_EVENT_CLOSE OR $msg==$ext Then
        update()
        exit(0)
    EndIf
until 0

here are some screens:

Posted Image Posted Image

Edited by er453r
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...