Jump to content
Sign in to follow this  

Crazy WinSetTrans

Recommended Posts


hey all, Ok, trying to make something that gets the Active Window, and turns it invisible and revisible

HoyKeySet("{PGDN}", "Invisible")

While 1

Func Invisible()    
    Local $list = WinList()
    For $i = 1 to $List[0][0]
        If WinActive($List[$i][0]) Then 
            $trans = _WinGetTrans($List[$i][0])
            WinSetTrans($list[$i][0], "", $Trans-5)

Func _WinGetTrans($sTitle, $sText = "")
    Local $hWnd = WinGetHandle($sTitle, $sText)
    If Not $hWnd Then Return -1
    Local $aRet = DllCall("user32.dll", "int", "GetLayeredWindowAttributes", "hwnd", $hWnd, "ptr", 0, "int_ptr", 0, "ptr", 0)
    If @error Or Not $aRet[0] Then Return -1
    Return $aRet[3]
EndFunc ; _WinGetTrans()

For some reason, when i push the hotkey, it makes the window more transparent, but it doesn't stop and just keeps on going to invisible, then it resets itself and slowly fades invisible once again. etc. etc.

Any idea why?

EDIT: Should probly say that the '_WinGetTrans' Function only works for Windows XP, I found it posted by Valik

Edited by Paulie

Share this post

Link to post
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

Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.