- ' 其中vFlags参数决定用户需要做的关机操作,
- ' dwReserved参数是作为保留而没有使用。
- Private Declare Function ExitWindowsEx Lib "user32" (ByVal uFlags As Long,ByVal dwReserved As Long) As Long
- Const ShutDown = 1
- Const ReBoot = 2
- Const LogOff = 0
- Dim Sh As Long
- ' 关闭计算机选项
- Sh = ExitWindowsEx(ShutDown, dwReserved)
- ' 重新启动计算机选项
- Sh = ExitWindowsEx(ReBoot, dwReserved)
- ' 关闭所有程序并以其他用户身份登录选项
- Sh = ExitWindowsEx(LogOff, dwReserved)
|