找回密码
 加入
搜索
楼主: ytxldc

用“MsgBox”做了个窗口,怎么实现按“是”电脑自动重启

  [复制链接]
发表于 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
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-10-1 09:41 , Processed in 0.065187 second(s), 14 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表