請選擇 進入手機版 | 繼續訪問電腦版

微剋多資訊

 找回密碼
 註冊

Sign in with google

Google帳號登入

搜索

該用戶從未簽到

升級   0%

發表於 2012-10-5 15:57 | 顯示全部樓層 |閱讀模式
本帖最後由 rictirse 於 2012-11-5 23:40 編輯

第四課教 模組化的 安裝
非常方便修改與維護 一個自動安裝大概只需要4~5分鐘就可以完成了!!
看影片教學最簡單惹!!!

[code=autoit]#cs ----------------------------------------------------------------------------

AutoIt Version: 3.3.8.1
Author:        Dang Wang

Script Function: Install DEMO
        Template AutoIt script.

#ce ----------------------------------------------------------------------------
#NoTrayIcon
AutoItSetOption ( "WinTitleMatchMode", 4)

GUISetIcon  (@ScriptDir&"/NewDang.ico")

Dim Const $FileName= ""
Dim Const $FormName = ""

;------- (1 Click;2 Check;3 UnCheck;4 SetText )-------
;------- (TitleName, Text, ControlID , Flag↑, SetText)-------

Dim $Text[14][5] = [ [ $FormName, "Enter Text", "ButtonName", 1, ""], _
                                                        [ $FormName, "Enter Text", "ButtonName", 1, ""], _
                                                        [ $FormName, "Enter Text", "ButtonName", 1, ""] ]


$begin = TimerInit()

While 1
        For $i = 0 To UBound ( $Text, 1)-1
                Select
                        Case WinExists ( $Text[$i][0], $Text[$i][1])
                                If $Text[$i][3] = 1 Then
                                        ControlClick ( $Text[$i][0], $Text[$i][1], $Text[$i][2])
                                ElseIf $Text[$i][3] = 2 Then
                                        ControlCommand ( $Text[$i][0], $Text[$i][1], $Text[$i][2], "Check", "")
                                ElseIf $Text[$i][3] = 3 Then
                                        ControlCommand ( $Text[$i][0], $Text[$i][1], $Text[$i][2], "UnCheck", "")
                                ElseIf $Text[$i][3] = 4 Then
                                        ControlSetText ( $Text[$i][0], $Text[$i][1], $Text[$i][2], $Text[$i][4])

                                EndIf
                                If $i = (UBound ( $Text, 1)-1) Then ExitLoop(2)
                EndSelect
        Next
WEnd
_Patch()

$dif = TimerDiff  ($begin)
MsgBox ( 0, "安裝完成", StringFormat ( "總安裝時間:%s秒", $dif/1000))[/code]
樓主熱門主題
您需要登入後才可以回帖 登入 | 註冊

本版積分規則

小黑屋|Archiver|微剋多資訊(MicroDuo)

GMT+8, 2024-3-29 01:12

Discuz! X

© 2009-2023 Microduo

快速回覆 返回頂部 返回列表