找回密码
 加入
搜索
查看: 1437|回复: 1

AU3

[复制链接]
发表于 2009-4-8 20:27:17 | 显示全部楼层 |阅读模式
源代码如下:


#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
#include <File.au3>
#include <Array.au3>
#include <StaticConstants.au3>
Opt("GUIOnEventMode", 1);OnEvent模式

$title = "游戏目录搜索"
Global $Button[50][2],$i,$i2,$keys
Local $Total = IniReadSection("config.ini", "测试")
If WinExists($title) Then Exit
AutoItWinSetTitle($title)
_IEErrorHandlerRegister()
$oIE = ObjCreate("Shell.Explorer.2")
$Form1 = GUICreate($title, 900, 525)
GUISetOnEvent($GUI_EVENT_CLOSE, "set")
$Keys_Input = GUICtrlCreateInput("搜索内容", 625, 90, 89, 21)
GUICtrlSetColor(-1, 0x0A7604)
GUICtrlSetOnEvent($Keys_Input, "set")
GUICtrlSetTip(-1, "请输入搜索内容")
$search = GUICtrlCreateButton("开始搜索", 733, 90, 56, 22, 0)
GUICtrlSetOnEvent($search, "set")
$Group1 = GUICtrlCreateGroup("★游戏目录", 8, 112, 81, 385)
GUICtrlCreateGroup("", -99, -99, 1, 1)

$s = 104
$s2 = 0
Dim $but, $job4, $link


For $I = 1 To $Total[0][0]

        $s2 = $s + 40
        $s = $s2

        $Button[$I][0] = GUICtrlCreateButton($Total[$I][0], 16, $s2, 64, 25, 0)
;~         按钮文字为INI等号左边的值,$Button[$I][0]为按钮控件ID

        $Button[$I][1] = $Total[$I][1];
;~         $Button[$I][1] 为INI等号右边的值,即要运行的程序。

        GUICtrlSetOnEvent($Button[$I][0], "B_Msg")
        GUICtrlSetTip($Button[$I][0], "点击观看→" & $Total[$I][0])

;~         将按钮点击注册到函数 B_Msg()

Next


$oIE.navigate("c:\")
ControlListView($title, "", "SysListView321", "ViewChange", "smallicons")
$GUIActiveX = GUICtrlCreateObj($oIE, 90, 117, 786, 380)

GUISetState()






While 1

        Sleep(100)

WEnd



Func set()


        Select

                Case @GUI_CtrlId = $search
                        $keys = GUICtrlRead($Keys_Input)
                        If $keys <> "" And $keys <> "搜索内容" Then
                                gosearch()
                        Else
                                MsgBox(64, "提示:", "请输入目录名称")
                        EndIf

                Case @GUI_CtrlId = $GUI_EVENT_CLOSE
                        Exit


        EndSelect

EndFunc   ;==>set
       

Func gosearch() ;查找目录 ==============  搜索目录段  就这里搞不定了。。。
    $keys2 = "\"&$keys&"*"
        ;$keys&"*"

       
For $I = 1 To $Total[0][0]
$FileList = _FileListToArray($Total, $keys2, 2)
        MsgBox(64,"PATH",$Total[$i][1]&$keys2)
        If @error = 1 Then
                MsgBox(0, "", "No Files\Folders Found.")
        ElseIf @error = 4 Then
                MsgBox(0, "非常抱歉:", "没找到该影片,请于管理员联系!")
        Else

msgbox(64,"box",$FileList)

EndIf
                        ;MsgBox(0, "", $FileList)


                Next
EndFunc   ;==>gosearch


Func B_Msg()
        ;MsgBox(64,"asdf","TEST")
        dim $s3
        For $I2 = 1 To UBound($Button, 1) - 1

                If @GUI_CtrlId = $Button[$I2][0] Then  $oIE.navigate($Button[$I2][1])       
               

Next
        ;MsgBox(64,"asdf",$s3)
EndFunc   ;==>B_Msg
发表于 2009-4-8 21:07:47 | 显示全部楼层
问题不说出来请大家去猜?
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-12-24 09:00 , Processed in 0.076128 second(s), 22 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表