home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form Form1
- BorderStyle = 1 'Fixed Single
- Caption = "Shut Down"
- ClientHeight = 2070
- ClientLeft = 2775
- ClientTop = 2775
- ClientWidth = 2670
- Height = 2475
- Icon = "Win95.frx":0000
- Left = 2715
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MouseIcon = "Win95.frx":0442
- MousePointer = 99 'Custom
- ScaleHeight = 2070
- ScaleWidth = 2670
- Top = 2430
- Width = 2790
- Begin VB.OptionButton Option2
- Caption = "Shut &Down The System"
- Height = 255
- Left = 240
- MouseIcon = "Win95.frx":0884
- MousePointer = 99 'Custom
- TabIndex = 3
- Top = 960
- Width = 2055
- End
- Begin VB.OptionButton Option1
- Caption = "&Reboot The System"
- Height = 255
- Left = 240
- MouseIcon = "Win95.frx":0CC6
- MousePointer = 99 'Custom
- TabIndex = 2
- Top = 360
- Width = 1815
- End
- Begin VB.CommandButton Command2
- Caption = "&Cancel"
- Height = 375
- Left = 1440
- MouseIcon = "Win95.frx":1108
- MousePointer = 99 'Custom
- TabIndex = 1
- Top = 1560
- Width = 975
- End
- Begin VB.CommandButton Command1
- Caption = "&Shut Down"
- Height = 375
- Left = 120
- MouseIcon = "Win95.frx":154A
- MousePointer = 99 'Custom
- TabIndex = 0
- Top = 1560
- Width = 975
- End
- Begin VB.Image Image2
- Height = 480
- Left = 720
- Picture = "Win95.frx":198C
- Top = 2520
- Width = 480
- End
- Begin VB.Image Image1
- Height = 480
- Left = 120
- Picture = "Win95.frx":1DCE
- Top = 2520
- Width = 480
- End
- Attribute VB_Name = "Form1"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Option Explicit
- Private Declare Function ExitWindowsEx Lib "user32" (ByVal uFlags As Long, ByVal dwReserved As Long) As Long
- Private Const EWX_FORCE = 4
- Private Const EWX_LOGOFF = 0
- Private Const EWX_REBOOT = 2
- Private Const EWX_SHUTDOWN = 1
- Private Sub Command1_Click()
- Dim nRet As Long
- If Option1.Value = True Then
- MsgBox ("Rebooting Windows")
- nRet = ExitWindowsEx(EWX_REBOOT, 0&)
- Else
- If Option2.Value = True Then
- MsgBox ("Shutting Down Windows")
- nRet = ExitWindowsEx(EWX_SHUTDOWN, 0&)
- Else
- If nRet = False Then
- MsgBox ("Could Not Exit Windows")
- End If
- End If
- End If
- End Sub
- Private Sub Command1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
- Command1.MouseIcon = Image1.Picture
- End Sub
- Private Sub Command1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
- Command1.MouseIcon = Image2.Picture
- End Sub
- Private Sub Command2_Click()
- Unload Me
- End
- End Sub
- Private Sub Command2_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
- Command2.MouseIcon = Image1.Picture
- End Sub
- Private Sub Command2_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
- Command2.MouseIcon = Image2.Picture
- End Sub
- Private Sub Form_Load()
- Me.Move 0, 0
- End Sub
- Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
- Me.Icon = Image1.Picture
- Me.MouseIcon = Image1.Picture
- Me.Caption = "Light On"
- End Sub
- Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
- Me.Icon = Image2.Picture
- Me.MouseIcon = Image2.Picture
- Me.Caption = "Light Off"
- End Sub
-