怎么用VB封锁系统啊,急急急!!!!!!!!!

来源:百度知道 编辑:UC知道 时间:2024/06/17 04:40:33
我用VB编写了一个《定时使用》程序,就是当时间到达开始时所设定的时间后,系统处于完全封锁状态,所有系统功能将不可用(包括“开始”菜单),只有输入用户名和密码后才能使用。

Option Explicit
Private Const EWX_LogOff As Long = 0
Private Const EWX_SHUTDOWN As Long = 1
Private Const EWX_REBOOT As Long = 2
Private Const EWX_FORCE As Long = 4
Private Const EWX_POWEROFF As Long = 8

'The ExitWindowsEx function either logs off, shuts down, or shuts
'down and restarts the system.
Private Declare Function ExitWindowsEx Lib "user32" _
(ByVal dwOptions As Long, _
ByVal dwReserved As Long) As Long

'The GetLastError function returns the calling thread's last-error
'code value. The last-error code is maintained on a per-thread basis.
'Multiple threads do not overwrite each other's last-error code.
Private Declare Function GetLastError Lib "kernel32" () As Long

Private Const mlngWindows95 = 0
Private Const mlngWindowsNT = 1