GUICreate('运行程序集', 502, 238)
$Button1 = GUICtrlCreateButton('运行QQ', 56, 104, 105, 41)
$Button2 = GUICtrlCreateButton('运行迅雷', 196, 102, 105, 41)
$Button3 = GUICtrlCreateButton('运行酷狗', 336, 104, 105, 41)
GUISetState()
Local $Pid, $ExeFlag
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case -3
Exit
Case $Button1
$Pid = _RunMyExe(@ScriptDir & '\QQ.exe')
Case $Button2
$Pid = _RunMyExe('Thunder.exe 实际路径')
Case $Button3
$Pid = _RunMyExe('KuGou.exe 实际路径')
EndSwitch
If $ExeFlag And Not ProcessExists($Pid) Then
GUISetState()
$ExeFlag = 0
EndIf
WEnd
Func _RunMyExe($Exe)
Local $Pid = Run($Exe)
If Not $Pid Then Return MsgBox(48, '', $Exe & ' 运行失败,请确认路径')
GUISetState(@SW_HIDE)
$ExeFlag = 1
Return $Pid
EndFunc ;==>_RunMyExe
|