Jump to content
Sign in to follow this  

fade out and background

Recommended Posts

how do i fade out a window with a pic with a transparent backgroundcolor? following exemple fades out a 'close'-button in two different ways. At the beginning the image is cut out correctly and the background is transparent. But while fading out there is always blue background... why?!

#include <GUIConstants.au3>
#include <Array.au3>
HotKeySet("{ESC}", "f_Terminate")

AutoItSetOption ( "TrayIconDebug", 1 )
Opt("WinTitleMatchMode", 3) 
Opt("GUIOnEventMode", 1)

$parent = GUICreate("Gui", 200, 100, 50, 45, BitOr($WS_POPUP, $WS_BORDER), BitOr($WS_EX_TOPMOST,$WS_EX_TOOLWINDOW))
$close = GUICreate("Close", 17, 20, @DesktopWidth/2, @DesktopHeight/2, $WS_POPUP, $WS_EX_LAYERED, $parent)
GUICtrlCreatePic(@ScriptDir & '\close2.gif', 0, 0, 17, 20)
GUISetState (@SW_SHOW)


For $i = 0 To 255
        WinSetTrans($close, "", 255-$i)

WinSetTrans($close, "", 255)
GUISetState (@SW_SHOW)

DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $close, "int", 3000, "long", 0x00090000);fade-out

Func f_Terminate()


Edited by Laetterman

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  

  • Create New...