#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Include <Array.au3>
#Include <File.au3>
$Form1 = GUICreate("",400,200,-1,-1)
$Input = GUICtrlCreateInput(" 点 击 此 处 选 择 文 件",100,51,200,21)
GUICtrlSetState(-1,$GUI_DISable)
$Button1 = GUICtrlCreateButton("确认",100,100,76, 25)
$Button2 = GUICtrlCreateButton("退出",225,100,76, 25)
GUISetState(@SW_SHOW)
AdlibEnable("Timer")
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE,$Button2
Exit
Case $GUI_EVENT_PRIMARYDOWN
$pos = GUIGetCursorInfo($Form1)
If $pos[4] = $Input Then
$oPath = FileSelectFolder("选择一个文件夹","")
GUICtrlSetData($Input,$oPath)
EndIf
Case $Button1
$path = GUICtrlRead($Input)
$oFile = _FileListToArray($path,"*.xls",1)
If @error Then
MsgBox(16,"!警告!","请正确选择文件夹")
Else
MsgBox(64,"ok","okokokokokokokokokokokok")
EndIf
EndSwitch
WEnd
Func Timer()
For $a =100 To 255
GUISetBkColor("0x"&Hex($a,2)&"0000",$Form1)
Sleep(20)
Next
For $a = 0 To 255
GUISetBkColor("0xff"&Hex($a,2)&"00",$Form1)
Sleep(20)
Next
For $a = 0 To 200
GUISetBkColor("0xffff"&Hex($a,2),$Form1)
Sleep(20)
Next
For $a = 200 To 0 Step -1
GUISetBkColor("0xffff"&Hex($a,2),$Form1)
Sleep(20)
Next
For $a = 255 To 0 step -1
GUISetBkColor("0xff"&Hex($a,2)&"00",$Form1)
Sleep(20)
Next
For $a = 255 To 100 step -1
GUISetBkColor("0x"&Hex($a,2)&"0000",$Form1)
Sleep(20)
Next
EndFunc
|