当前位置:三九宝宝网 → 宝宝成长 → 宝宝手工 → 正文

怎么利用vb制作个快速关机程序

更新:01-06 整理:39baobao.com
字体:

'你需要画一个timer,名字叫timer1,然后把代码复制就可以了。 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 ExitWindow〖HmhK〗环保过滤 function either logs off, shuts down, or shuts 'down and restarts the system. Private Declare Function ExitWindow〖HmhK〗环保过滤 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 Type LUID UsedPart As Long IgnoredForNowHigh32BitPart As Long End Type Private Type LUID_AND_ATTRIBUTES TheLuid As LUID Attributes As Long End Type Private Type TOKEN_PRIVILEGES PrivilegeCount As Long TheLuid As LUID Attributes As Long End Type 'The GetCurrentProcess function returns a pseudohandle for the 'current process. Private Declare Function GetCurrentProcess Lib "kernel32" () As Long 'The OpenProcessToken function opens the access token associated with 'a process. Private Declare Function OpenProcessToken Lib "advapi32" (ByVal ProcessHandle As Long, _ ByVal DesiredAccess As Long, TokenHandle As Long) As Long 'The LookupPrivilegeValue function retrieves the locally unique 'identifier (LUID) used on a specified system to locally represent 'the specified privilege name. Private Declare Function LookupPrivilegeValue Lib "advapi32" _ Alias "LookupPrivilegeValueA" _ (ByVal lpSystemName As String, _ ByVal lpName As String, _ lpLuid As LUID) As Long 'The AdjustTokenPrivileges function enables

本文地址:https://www.39baobao.com/show/15_5410.html

以上内容来自互联网,请自行判断内容的正确性。若本站收录的信息无意侵犯了贵司版权,请联系我们,我们会及时处理和回复,谢谢.