本帖最后由 xyold1 于 2010-10-30 21:41 编辑
迅雷7的新建任务窗口的打开关闭特效做得很不错,用AU3实现也很容易,下面代码,只是模仿得不太像,有兴趣的高手帮帮优化一下。
另:在测试程序的时候产生了很多的conime.exe进程,不知为什么,请专家解惑。
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
Global $Form1_1
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("窗口测试", 205, 120, 192, 124)
GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close")
$Button1 = GUICtrlCreateButton("测试", 56, 40, 97, 33)
GUICtrlSetOnEvent(-1, "Button1Click")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
Sleep(100)
WEnd
Func Form1Close()
Exit
EndFunc
Func Button1Click()
#Region ### START Koda GUI section ### Form=
$Form1_1 = GUICreate("Show me", 237, 78, 172, 104, -1,-1,$Form1)
GUISetOnEvent($GUI_EVENT_CLOSE, "Form1_1Close")
$Label1 = GUICtrlCreateLabel("动态显示效果测试:", 16, 16, 112, 17)
WinSetTrans ($Form1_1, "",0 )
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
$p=WinGetPos($Form1_1)
For $i=1 To 17
WinSetTrans ($Form1_1, "", $i*15 )
If $i<12 Then
$l=$i
WinMove($Form1_1, "", $p[0]-$l, $p[1]-$l, $p[2]+$l*2, $p[3]+$l*2)
$x=WinGetPos($Form1_1)
Else
$k=$i-12
WinMove($Form1_1, "", $x[0]+$k, $x[1]+$k, $x[2]-$k*2, $x[3]-$k*2)
EndIf
Sleep($i)
Next
EndFunc
Func Form1_1Close()
For $i=17 To 1 Step -1
WinSetTrans ($Form1_1, "", $i*15 )
$l=$i
$p=WinGetPos($Form1_1)
WinMove($Form1_1, "", $p[0]-1, $p[1]-1, $p[2]+2, $p[3]+2)
Sleep(5)
Next
GUIDelete ( $Form1_1 )
EndFunc
|