#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$config_file=@ScriptDir&"\zhb.ini" ;定义变量=c:\windows\system32\zhb.ini
Global $program
If FileExists($config_file) Then
;MsgBox(0,"提示","文件已存在")
Else
$msgbox=MsgBox(4+64,"提示",$config_file&"配置文件不存在"&@CRLF & @CRLF &"是否要生成配置文件")
Select
Case $msgbox=6
xuanze()
Case $msgbox=7
Exit
EndSelect
EndIf
$Form1 = GUICreate("Form1", 297, 209, 192, 114)
$Checkbox1 = GUICtrlCreateCheckbox("Checkbox1", 112, 72, 97, 17)
$Button1 = GUICtrlCreateButton("Button1", 120, 128, 75, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
If GUICtrlRead($checkbox1)=$gui_checked Then
$var=IniRead($config_file,"config","path","")
$q = FileExists($var)
If $q = 0 Then
xuanze()
Run ($program)
Else
Run ($var)
EndIf
Else
MsgBox(0,"提示","未选中")
EndIf
EndSwitch
WEnd
Func xuanze()
$program=FileOpenDialog("请选择QQ启动文件","","可执行文件(*.exe)",1+1)
If Not @error Then IniWrite($config_file,"config","path",$program)
EndFunc
随便在你的代码上改了下 |