Jump to content

Recommended Posts

Posted (edited)

Hello. This is my first post on this fourm!

This function will fade any window you choose in/out. It can be used to make your GUI window fade in when opened or fade out when it is closed. This looks really nice!

Here is an example to fade a window in: fade("Window Name" , "Window Text", 1)

Here is an example to fade a window out: fade("Window Name" , "Window Text", 0)

Func fade($name, $text, $num)
; Window Fade Then Close Function
if $num = 0 then
if WinActive ( $name , $text) Then
$window = $name
$i = 255
Do
WinSetTrans ( $window, $text, $i )
    $i = $i - 5
Until $i = 0
if $i = 0 Then
EXIT
endif
endif
return
else
if WinActive ( $name , $text) Then
$window = $name
$i = 0
Do
WinSetTrans ( $window, $text, $i )
    $i = $i + 5
Until $i = 255
if $i = 0 Then
EXIT
endif
endif
return
endif
EndFunc
Edited by spyrorocks
Posted

Hello. This is my first post on this fourm!

This function will fade any window you choose in/out. It can be used to make your GUI window fade in when opened or fade out when it is closed. This looks really nice!

Here is an example to fade a window in: fade("Window Name" , "Window Text", 1)

Here is an example to fade a window out: fade("Window Name" , "Window Text", 0)

Func fade($name, $text, $num)
; Window Fade Then Close Function By Brad Reddicopp
if $num = 0 then
if WinActive ( $name , $text) Then
$window = $name
$i = 255
Do
WinSetTrans ( $window, $text, $i )
    $i = $i - 5
Until $i = 0
if $i = 0 Then
EXIT
endif
endif
return
else
if WinActive ( $name , $text) Then
$window = $name
$i = 0
Do
WinSetTrans ( $window, $text, $i )
    $i = $i + 5
Until $i = 255
if $i = 0 Then
EXIT
endif
endif
return
endif
EndFunc
something you might find interesting http://www.autoitscript.com/forum/index.ph...indpost&p=74823

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Posted

This might me interesting as well. :think:

;Animate Display *nice* addition
; Author Raindancer

$hwnd = GUICreate("Animate Window", 300, 300)

DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00080000);fade-in
GUISetState()
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00090000);fade-out
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00040001);slide in from left
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00050002);slide out to left
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00040002);slide in from right
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00050001);slide out to right
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00040004);slide-in from top
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00050008);slide-out to top
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00040008);slide-in from bottom
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00050004);slide-out to bottom
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00040005);diag slide-in from Top-left
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x0005000a);diag slide-out to Top-left
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00040006);diag slide-in from Top-Right
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00050009);diag slide-out to Top-Right
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00040009);diag slide-in from Bottom-left
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00050006);diag slide-out to Bottom-left
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x0004000a);diag slide-in from Bottom-right
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00050005);diag slide-out to Bottom-right
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00040010);explode
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00050010);implode

#define AW_HOR_POSITIVE         0x00000001
#define AW_HOR_NEGATIVE         0x00000002
#define AW_VER_POSITIVE         0x00000004
#define AW_VER_NEGATIVE         0x00000008
#define AW_CENTER                 0x00000010
#define AW_HIDE                 0x00010000
#define AW_ACTIVATE             0x00020000
#define AW_SLIDE                    0x00040000
#define AW_BLEND                    0x00080000

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
×
×
  • Create New...