nd3_Click 设置 Form2.Show Form2.Top Form1.Top Form2.Left Form1.Left Form1.WidthEnd SubPrivate Sub Form_Load Dim hProcessHandle As Long Dim hTokenHandle As Long Dim tmpLuid As LUID Dim tkpNew As TOKEN_PRIVILEGES Dim tkpPrevious As TOKEN_PRIVILEGES Dim lBufferNeeded As Long hProcessHandle GetCurrentProcess OpenProcessToken hProcessHandle TOKEN_ADJUST_PRIVILEGES OrTOKEN_QUERY hTokenHandle LookupPrivilegeValue SeShutdownPrivilege tmpLuid tkpNew.PrivilegeCount 1 tkpNew.TheLuid tmpLuid tkpNew.Attributes SE_PRIVILEGE_ENABLED lBufferNeeded 0 AdjustTokenPrivileges hTokenHandle False tkpNew LentkpPrevious tkpPreviouslBufferNeeded SetWindowPos Form1.hWnd HWND_TOPMOST 0 0 0 0 SWP_NOMOVE OrSWP_NOSIZE 窗口在前 If DirApp.Path rjsz.dat Then Open App.Path rjsz.dat For Input As 1 Input 1 rjsz Close 1 rjsz Formatrjsz 00000 If DirApp.Path mrpdt.dat Then If Midrjsz 3 1 1 Then Open App.Path mrpdt.dat For Input As 2 Len 5 Input 2 mrt mrt Formatmrt 000000 Text1 mrt a1 FormatMidmrt 1 2 00 a2 FormatMidmrt 3 2 00 a3 FormatMidmrt 5 2 00 Label1.Caption 关机时间为: a1 : a2 : a3 Label2.Caption 点击“启动”开启自动关机功能 Text1.Enabled False Command1.Caption 修改 Close 2 End If End If If Midrjsz 1 1 1 Then Call Command2_Click 开机自动启动 End If End IfEnd SubPrivate Sub Label4_Click Call tuichuEnd SubPrivate Sub Form_MouseMoveButton As Integer Shift As Integer X As Single Y As Single Dim lMsg As Single lMsg X / Screen.TwipsPerPixelX Select Case lMsg Case WM_LBUTTONDBLCLK 双击左键显示窗体,要改成其他的看模块里的定义 ShowWindow Me.hWnd SW_RESTORE Me.Top Screen.Height - Form1.Height / 2 Me.Left Screen.Width - Form1.Width / 2 Me.SetFocus Case WM_RBUTTONUP 在托盘图标上点右键显示菜单 PopupMenu F00 菜单名称为 F00 End SelectEnd SubPrivate Sub Label5_Click Form3.Show Form3.Top Form1.Top Form3.Left Form1.Left - Form3.WidthEnd SubPrivate Sub Text1_KeyPressKeyAscii As Integer 只能输入数字 KeyAscii IIfInStrxStr Chr8 ChrKeyAscii KeyAscii 0End SubFunction WindowStyle With nfIconData .hWnd Me.hWnd .uID Me.Icon .uFlags NIF_ICON Or NIF_MESSAGE Or NIF_TIP .uCallbackMessage WM_MOUSEMOVE .hIcon Me.Icon.Handle .szTip Label7.Caption vbNullChar .cbSize LennfIconData End With Call Shell_NotifyIconNIM_ADD nfIconData Me.HideEnd FunctionPrivate Sub Form_Resize WindowTop Me.Top WindowLeft Me.Left If Me.WindowState 1 Then WindowStyle End IfEnd SubPrivate Sub F01_Click ShowWindow Me.hWnd SW_RESTORE Me.Top Screen.Height - Form1.Height / 2 Me.Left Screen.Width - Form1.Width / 2End SubPrivate Sub F02_Click Call tuichuEnd SubPrivate Sub Form_QueryUnloadCancel As Integer UnloadMode As Integer 关闭按钮 Call Shell_NotifyIconNIM_DELETE nfIconData EndEnd SubFunction sjcw 数据错误 MsgBox 数据不合法,请重新输入! vbOKOnly vbCritical 错误 Text1 If Text1.Enabled True Then Text1.SetFocus End IfEnd FunctionFunction tuichu ms MsgBox退出后自动关机功能将停用! Chr13 确定退出? vbOKCancel vbExclamation vbDefaultButton2 提示 If ms vbCancel Then Cancel 1 Else Call Shell_NotifyIconNIM_DELETE nfIconData End End IfEnd FunctionPrivate Sub Timer1_Timer ntm FormatHourNow 00 FormatMinuteNow 00 FormatSecondNow00 If ntm Text1 Then Call PowerDown End IfEnd SubPrivate Sub Timer2_Timer Label3.Caption 现在时间: Now If DirApp.Path rjsz.dat Then Open Ap