📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form Form1
BorderStyle = 1 'Fixed Single
Caption = "注销、重启和关闭"
ClientHeight = 2070
ClientLeft = 45
ClientTop = 330
ClientWidth = 1875
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2070
ScaleWidth = 1875
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command1
Caption = "确定"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 240
TabIndex = 3
Top = 1560
Width = 1455
End
Begin VB.OptionButton Option3
Caption = "注销用户"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 240
TabIndex = 2
Top = 1080
Width = 1335
End
Begin VB.OptionButton Option2
Caption = "重新启动"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 240
TabIndex = 1
Top = 720
Width = 1452
End
Begin VB.OptionButton Option1
Caption = "关闭计算机"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 240
TabIndex = 0
Top = 360
Width = 1572
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Declare Function ExitWindowsEx Lib "user32" (ByVal uFlags As Long, ByVal dwReserved As Long) As Long
Public Opt As String ' Make Opt a string
Private Sub Command1_Click()
HandleOpt ' Run Function HandleOpt
End Sub
Private Sub Form_Load()
Opt = "shutdown" ' make Opt ShutDown
End Sub
Private Sub Option1_Click()
Opt = "shutdown" ' make Opt ShutDown
End Sub
Private Sub Option2_Click()
Opt = "restart" ' make Opt Restart
End Sub
Private Sub Option3_Click()
Opt = "logoff" ' make Opt logoff
End Sub
Public Function HandleOpt()
Select Case Opt ' See what Opt is
Case "shutdown": ' If Opt is shutdown then
ExitWindowsEx EWX_SHUTDOWN, 0 ' ShutDown
Case "restart": ' If Opt is restart then
ExitWindowsEx EWX_REBOOT, 0 ' Restart
Case "logoff" ' If Opt is logoff then
ExitWindowsEx EWX_LOGOFF, 0 ' Logoff
End Select ' End see what Opt is
End Function
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -