home *** CD-ROM | disk | FTP | other *** search
Wrap
VERSION 5.00 Object = "{C5C08340-4E2C-11D0-88EB-444553540000}#2.5#0"; "TUNEIT.OCX" Begin VB.Form Form_Main BorderStyle = 1 'Fixed Single Caption = "Fast Down" ClientHeight = 5430 ClientLeft = 1335 ClientTop = 720 ClientWidth = 5070 Icon = "Form_Main.frx":0000 KeyPreview = -1 'True LinkTopic = "Form1" MaxButton = 0 'False PaletteMode = 1 'UseZOrder ScaleHeight = 5430 ScaleWidth = 5070 WindowState = 1 'Minimized Begin VB.Timer Timer1 Interval = 800 Left = 4200 Top = 3840 End Begin VB.Frame Frame_Options Caption = "Options " Height = 1452 Left = 240 TabIndex = 10 Top = 1920 Width = 3612 Begin VB.CheckBox Check_AutoRun Caption = "R&un at Windows startup" Height = 372 Left = 600 TabIndex = 6 Top = 840 Value = 1 'Checked Width = 2892 End Begin VB.CheckBox Check_WarnUser Caption = "&Warn before shut down" Height = 372 Left = 600 Picture = "Form_Main.frx":0442 TabIndex = 5 Top = 360 Value = 1 'Checked Width = 2892 End Begin VB.Image Image3 Height = 480 Left = 120 Picture = "Form_Main.frx":0884 Top = 840 Width = 480 End Begin VB.Image Image2 Height = 480 Left = 120 Picture = "Form_Main.frx":0B8E Top = 360 Width = 480 End End Begin VB.OptionButton Option_LogOff Height = 372 Left = 3960 TabIndex = 9 Top = 1320 Width = 1092 End Begin VB.OptionButton Option_Restart Height = 372 Left = 3960 TabIndex = 8 Top = 840 Width = 1092 End Begin VB.OptionButton Option_ShutDown Caption = "Ctrl + F12" Height = 372 Left = 3960 TabIndex = 7 Top = 360 Value = -1 'True Width = 1092 End Begin VB.CommandButton Button_LogOff Caption = "&Log on as a different user" Height = 372 Left = 240 TabIndex = 4 Top = 1320 Width = 3612 End Begin VB.CommandButton Button_Restart Caption = "&Restart the computer" Height = 372 Left = 240 TabIndex = 3 Top = 840 Width = 3612 End Begin VB.CommandButton Button_Exit Caption = "E&xit" Height = 372 Left = 2160 TabIndex = 1 Top = 4920 Width = 1692 End Begin VB.CommandButton Button_ShutDown Caption = "&Shut down the computer" Height = 372 Left = 240 TabIndex = 2 Top = 360 Width = 3612 End Begin VB.CommandButton Button_About Caption = "&About" Height = 372 Left = 240 TabIndex = 0 Top = 4920 Width = 1692 End Begin VB.Label Label1 Appearance = 0 'Flat BackColor = &H00000000& Caption = "Label1" ForeColor = &H80000008& Height = 12 Left = 240 TabIndex = 13 Top = 4680 Width = 3612 End Begin VB.Label Label_Elapsed ForeColor = &H00800000& Height = 372 Left = 240 TabIndex = 12 Top = 4200 Width = 3732 End Begin VB.Label Label_User Caption = "Windows user name" ForeColor = &H00008000& Height = 372 Left = 240 TabIndex = 11 Top = 3840 Width = 3732 End Begin TuneItLib.TuneIt TuneIt1 Left = 4200 Top = 4680 _Version = 131077 _ExtentX = 1270 _ExtentY = 1207 _StockProps = 64 BeginProperty CaptionFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} Name = "MS Sans Serif" Size = 8.25 Charset = 178 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty BeginProperty SmallCaptionFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} Name = "MS Sans Serif" Size = 8.25 Charset = 178 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty BeginProperty StatusFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} Name = "MS Sans Serif" Size = 8.25 Charset = 178 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty BeginProperty MessageFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} Name = "MS Sans Serif" Size = 8.25 Charset = 178 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty BeginProperty MenuFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} Name = "MS Sans Serif" Size = 8.25 Charset = 178 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty BeginProperty IconTitleFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} Name = "MS Sans Serif" Size = 8.25 Charset = 178 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty End Attribute VB_Name = "Form_Main" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Long) As Long Const WM_SETHOTKEY = &H32 Const HOTKEYF_SHIFT = 1 Const HOTKEYF_CONTROL = 2 Const HOTKEYF_ALT = 4 Dim HotKey As Long, HotKeyModifier As Long Private Sub Button_About_Click() Form_About.Show 1 End Sub Private Sub Button_Exit_Click() Unload Me End Sub Private Sub Set_AutoRun() CustomName = "Fast Down" If Check_AutoRun.Value = 1 Then FullFileName = App.Path + "\" + App.EXEName + ".EXE" TuneIt1.AutoRun FullFileName, CustomName Else TuneIt1.AutoRun "", CustomName End If End Sub Private Sub Button_LogOff_Click() '**** If user selected to be warned '**** before shut down, ask him/her. If Check_WarnUser.Value = 1 Then If MsgBox("Log on as a different user ?", vbOKCancel + vbExclamation) = vbCancel Then Exit Sub End If End If Set_AutoRun '**** This line logs off the current user '**** and shows the log on window !!! TuneIt1.LogOff End Sub Private Sub Button_Restart_Click() '**** If user selected to be warned '**** before Restart, ask him/her. If Check_WarnUser.Value = 1 Then If MsgBox("Restart the computer ?", vbOKCancel + vbExclamation) = vbCancel Then Exit Sub End If End If Set_AutoRun '**** This line reboots the system !!! TuneIt1.Reboot End Sub Private Sub Button_ShutDown_Click() '**** If user selected to be warned '**** before shut down, ask him/her. If Check_WarnUser.Value = 1 Then If MsgBox("Shut down ?", vbOKCancel + vbExclamation) = vbCancel Then Exit Sub End If End If Set_AutoRun '**** This line shuts down the system !!! TuneIt1.ShutDown End Sub Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer) '''' Check to see if the key is exactly the hot key. '''' If KeyCode = HotKey And Shift = HotKeyModifier Then '''' Which action assigned to the hot key? '''' '''' ( Shut down, Windows restart or Log on ... ) '''' If Option_ShutDown.Value = True Then Button_ShutDown_Click ElseIf Option_Restart.Value = True Then Button_Restart_Click Else Button_LogOff_Click End If End If End Sub Private Sub Form_Load() Dim RetVal As Long '**** Define the application hotkey and a key modifier '**** if desired ( Shift, Ctrl or Alt key ). HotKey = vbKeyF12 HotKeyModifier = HOTKEYF_CONTROL '**** Use the SendMessage(...) API function to assign '**** the hot key to the application's main form. RetVal = SendMessage(Me.hwnd, WM_SETHOTKEY, HotKey + HotKeyModifier * &H100, 0) End Sub Private Sub Form_Unload(Cancel As Integer) Set_AutoRun End Sub Private Sub Image2_Click() '**** Changing the state of the "Warn before shut down" check box. If Check_WarnUser.Value = 0 Then Check_WarnUser.Value = 1 Else Check_WarnUser.Value = 0 End If End Sub Private Sub Image3_Click() '**** Changing the state of the "Run at Windows start" check box. If Check_AutoRun.Value = 0 Then Check_AutoRun.Value = 1 Else Check_AutoRun.Value = 0 End If End Sub Private Sub Option_LogOff_Click() Option_ShutDown.Caption = "" Option_Restart.Caption = "" Option_LogOff.Caption = "Ctrl + F12" End Sub Private Sub Option_Restart_Click() Option_ShutDown.Caption = "" Option_Restart.Caption = "Ctrl + F12" Option_LogOff.Caption = "" End Sub Private Sub Option_ShutDown_Click() Option_ShutDown.Caption = "Ctrl + F12" Option_Restart.Caption = "" Option_LogOff.Caption = "" End Sub Private Sub Timer1_Timer() '**** This timer is used to show the elapsed '**** time since Windows has been started. ElapsedTime = Format(Now - TuneIt1.WindowsStartupTime, "hh:nn:ss") Label_Elapsed.Caption = "Elapsed time since Windows start : " & ElapsedTime '**** Show the current Windows user... Label_User.Caption = "Windows user : " & TuneIt1.WindowsUserName End Sub