home *** CD-ROM | disk | FTP | other *** search
/ Prima Shareware 3 / DuCom_Prima-Shareware-3_cd1.bin / PROGRAMO / VB40 / RESETWIN / WIN95.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1996-04-23  |  4.1 KB  |  128 lines

  1. VERSION 4.00
  2. Begin VB.Form Form1 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Caption         =   "Shut Down"
  5.    ClientHeight    =   2070
  6.    ClientLeft      =   2775
  7.    ClientTop       =   2775
  8.    ClientWidth     =   2670
  9.    Height          =   2475
  10.    Icon            =   "Win95.frx":0000
  11.    Left            =   2715
  12.    LinkTopic       =   "Form1"
  13.    MaxButton       =   0   'False
  14.    MouseIcon       =   "Win95.frx":0442
  15.    MousePointer    =   99  'Custom
  16.    ScaleHeight     =   2070
  17.    ScaleWidth      =   2670
  18.    Top             =   2430
  19.    Width           =   2790
  20.    Begin VB.OptionButton Option2 
  21.       Caption         =   "Shut &Down The System"
  22.       Height          =   255
  23.       Left            =   240
  24.       MouseIcon       =   "Win95.frx":0884
  25.       MousePointer    =   99  'Custom
  26.       TabIndex        =   3
  27.       Top             =   960
  28.       Width           =   2055
  29.    End
  30.    Begin VB.OptionButton Option1 
  31.       Caption         =   "&Reboot The System"
  32.       Height          =   255
  33.       Left            =   240
  34.       MouseIcon       =   "Win95.frx":0CC6
  35.       MousePointer    =   99  'Custom
  36.       TabIndex        =   2
  37.       Top             =   360
  38.       Width           =   1815
  39.    End
  40.    Begin VB.CommandButton Command2 
  41.       Caption         =   "&Cancel"
  42.       Height          =   375
  43.       Left            =   1440
  44.       MouseIcon       =   "Win95.frx":1108
  45.       MousePointer    =   99  'Custom
  46.       TabIndex        =   1
  47.       Top             =   1560
  48.       Width           =   975
  49.    End
  50.    Begin VB.CommandButton Command1 
  51.       Caption         =   "&Shut Down"
  52.       Height          =   375
  53.       Left            =   120
  54.       MouseIcon       =   "Win95.frx":154A
  55.       MousePointer    =   99  'Custom
  56.       TabIndex        =   0
  57.       Top             =   1560
  58.       Width           =   975
  59.    End
  60.    Begin VB.Image Image2 
  61.       Height          =   480
  62.       Left            =   720
  63.       Picture         =   "Win95.frx":198C
  64.       Top             =   2520
  65.       Width           =   480
  66.    End
  67.    Begin VB.Image Image1 
  68.       Height          =   480
  69.       Left            =   120
  70.       Picture         =   "Win95.frx":1DCE
  71.       Top             =   2520
  72.       Width           =   480
  73.    End
  74. Attribute VB_Name = "Form1"
  75. Attribute VB_Creatable = False
  76. Attribute VB_Exposed = False
  77. Option Explicit
  78. Private Declare Function ExitWindowsEx Lib "user32" (ByVal uFlags As Long, ByVal dwReserved As Long) As Long
  79. Private Const EWX_FORCE = 4
  80. Private Const EWX_LOGOFF = 0
  81. Private Const EWX_REBOOT = 2
  82. Private Const EWX_SHUTDOWN = 1
  83. Private Sub Command1_Click()
  84.     Dim nRet As Long
  85.     If Option1.Value = True Then
  86.         MsgBox ("Rebooting Windows")
  87.         nRet = ExitWindowsEx(EWX_REBOOT, 0&)
  88.     Else
  89.         If Option2.Value = True Then
  90.             MsgBox ("Shutting Down Windows")
  91.             nRet = ExitWindowsEx(EWX_SHUTDOWN, 0&)
  92.         Else
  93.             If nRet = False Then
  94.                 MsgBox ("Could Not Exit Windows")
  95.             End If
  96.         End If
  97.     End If
  98.  End Sub
  99. Private Sub Command1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  100.     Command1.MouseIcon = Image1.Picture
  101. End Sub
  102. Private Sub Command1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
  103.     Command1.MouseIcon = Image2.Picture
  104. End Sub
  105. Private Sub Command2_Click()
  106.     Unload Me
  107.     End
  108. End Sub
  109. Private Sub Command2_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  110.     Command2.MouseIcon = Image1.Picture
  111. End Sub
  112. Private Sub Command2_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
  113.     Command2.MouseIcon = Image2.Picture
  114. End Sub
  115. Private Sub Form_Load()
  116.     Me.Move 0, 0
  117. End Sub
  118. Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  119.     Me.Icon = Image1.Picture
  120.     Me.MouseIcon = Image1.Picture
  121.     Me.Caption = "Light On"
  122. End Sub
  123. Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
  124.     Me.Icon = Image2.Picture
  125.     Me.MouseIcon = Image2.Picture
  126.     Me.Caption = "Light Off"
  127. End Sub
  128.