|
发表于 2011-11-11 11:21:47
|
显示全部楼层
#include <GUIConstantsEx.au3>
GUICreate("关机程序",200,300)
$label=GUICtrlCreateLabel("闲人无聊",20,100,100,100)
GUICtrlSetFont(3, 16, 400, 4)
GUICtrlSetColor(3,0x2a121)
guisetstate(@sw_show)
Dim $choice ,$box
$choice=InputBox("無聊","你可以在下面選項進行相應的操作"&"1立即重启"&@CRLF&" 2休眠"&@CRLF&" 3关机"&@CRLF&" 4待机"&@CRLF&" 5自定义关机时间")
Select
Case $choice=1
MsgBox(0,"提示","电脑将重启")
Shutdown(2)
Case $choice=2
MsgBox(0,"提示","电脑将休眠")
Shutdown(64)
Case $choice=3
MsgBox(0,"提示","电脑将关机")
Shutdown(1)
Case $choice=4
MsgBox(0,"提示","电脑将待机")
Shutdown(32)
Case $choice=5
$box=InputBox("无聊","输入你要在N秒后关机的N值(秒)"&@CRLF&"不关机请不要输入")
If $box="" Then
MsgBox(0,"无聊","程序会退出")
Exit
Else
MsgBox(0,"无聊","你的计算机将"&$box&"秒后关机")
sleep($box*1000)
Shutdown(1)
EndIf
EndSelect
While 1
$msg = GUIGetMsg()
If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd |
|