Opt("GUIOnEventMode", 1)
Dim $topdir = @DesktopDir
Dim $I1 = IniRead($topdir&"\Tests.ini", "URL", "EXE", "請選擇單一檔案")
Dim $I2 = IniRead($topdir&"\Tests.ini", "URL", "DIR", "請選擇資料夾")
Dim $I3 = IniRead($topdir&"\Tests.ini", "URL", "SAVE", "請選擇儲存路徑")
Dim $I4 = IniRead($topdir&"\Tests.ini", "URL", "ICON", "請選擇圖示檔案")
#Region ### START Koda GUI section ### Form=
$Form2 = GUICreate("轉換程式", 236, 182, 333, 270)
GUICtrlCreateGroup("", 0, -4, 235, 75)
GUICtrlSetFont(-1, 10, 400, 0, "新細明體")
$Input1 = GUICtrlCreateInput($I1, 12, 14, 179, 21)
GUICtrlSetState($Input1, $GUI_DISABLE)
$Input2 = GUICtrlCreateInput("", 12, 40, 179, 21)
GUICtrlSetState($Input2, $GUI_DISABLE)
$Checkbox1 = GUICtrlCreateCheckbox("Checkbox1", 204, 14, 13, 17)
GUICtrlSetOnEvent(-1, "Checkbox1Click")
$Checkbox2 = GUICtrlCreateCheckbox("Checkbox2", 204, 40, 13, 17)
GUICtrlSetOnEvent(-1, "Checkbox2Click")
GUICtrlCreateGroup("", -99, -99, 1, 1)
While 1
Sleep(100)
WEnd
Func _GuiEvents()
Switch @GUI_CtrlId
Case $GUI_EVENT_CLOSE
Exit
Case $GUI_EVENT_MINIMIZE
Case $GUI_EVENT_RESTORE
EndSwitch
EndFunc
Func Checkbox1Click()
If GUICtrlRead($Checkbox1)=$GUI_CHECKED Then
$exe = FileOpenDialog("選擇檔案", @DesktopDir & "", "自解檔 (*.exe)|全部(*.*)", 2+4)
If @error Then
MsgBox(4096,"","請選擇檔案。")
Else
$exe = StringReplace($exe, "|", @CRLF)
MsgBox(4096,"","您選擇的是:" & $exe)
EndIf
IniWrite($topdir&"\Tests.ini", "URL", "EXE", $exe)
$Input1 = GUICtrlCreateInput($exe, 12, 14, 179, 21)
GUICtrlSetState($Checkbox2, $GUI_DISABLE)
Else
EndIf
EndFunc