| = 0 ''''False
Italic = 0 ''''False
Strikethrough = 0 ''''False
EndProperty
Height = 390
Left = 480
TabIndex = 3
Top = 795
Width = 5190
End
End
Attribute VB_Name = "dlgShutDown"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
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_SHUTDOWN = 1
Private Const cTimeCount As Long = 15
Private lngCount As Long
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdShutDown_Click()
ExitWindowsEx EWX_SHUTDOWN, 0
End Sub
Private Sub Form_Load()
Dim myWin As New clsWindow
myWin.hwnd = Me.hwnd
myWin.TopMost = True
Set myWin = Nothing
lngCount = cTimeCount
myProc.Max = cTimeCount
myProc.Min = 0
Call myTimer_Timer
End Sub
Private Sub myTimer_Timer()
lngCount = lngCount - 1
myProc.Value = cTimeCount - lngCount
lblTitle.Caption = lngCount & "秒后关机"
If lngCount = 0 Then
ExitWindowsEx EWX_SHUTDOWN, 0
lngCount = cTimeCount
End If
End Sub
###############################################################################
mdlCopy.bas 内容
###############################################################################
Attribute VB_Name = "mdlCopy"
Option Explicit
Public Const c_NullID As Long = -9999
###############################################################################
clsCount.cls 内容
###############################################################################
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 ''''True
Persistable = 0 ''''NotPersistable
DataBindingBehavior = 0 ''''vbNone
DataSourceBehavior = 0 ''''vbNone
MTSTransactionMode = 0 ''''NotAnMTSObject
END
Attribute VB_Name = "clsCount"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit
''''******************************************************************************
''''**
''''** 用于计算速度的类模块
''''**
''''** 该类模块设定一个计数器,由程序不断的累计数据,并根据所花时间计算数据
''''**
''''** 编制: 袁永福
''''** 时间: 2002-4-2
''''**
''''******************************************************************************
Private Declare Function GetTickCount Lib "kernel32" () As Long
Private lngCountStart As Long
Private lngCountCurrent As Long
Private lngCountLast As Long
Private lngSpeed As Long
Private lngTickStart As Long
Private lngTickCurrent As Long
Private lngTickLast As Long
''''Public StopCount As Boolean
''''** 获得计数数据 **************************************************************
''''** 累计初始值
Public Property Get CountStart() As Long
CountStart = lngCountStart
End Property
''''** 累计终止值
Public Property Get CountEnd() As Long
CountEnd = lngCountCurrent
End Property
''''** 累计总的速度
Public Property Get TotalSpeed() As Long
If lngTickCurrent = lngTickStart Then
TotalSpeed = 0
Else
TotalSpeed = (lngCountCurrent - lngCountStart) / ((lngTickCurrent - lngTickStart) / 1000)
End If
End Property
''''** 累计所花毫秒数
Public Property Get TotalTickCount() As Long
TotalTickCount = lngTickCurrent - lngTickStart
End Property
''''** 清除所有数据 **************************************************************
Public Sub Clear()
lngCountStart = 0
lngCountCurrent = 0
lngCountLast = 0
lngSpeed = 0
lngTickStart = GetTickCount()
lngTickCurrent = lngTickStart
lngTickLast = lngTickStart
''''StopCount = False
End Sub
''''** 设置累计基数
Public Property Let CountStart(ByVal lStart As Long 上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] 下一页 |