blob: 4c725f5dbeb3338ca4409759dd769d8c4e9b531e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
|
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.ocx"
Begin VB.Form ShowProgress
BorderStyle = 1 'Fixed Single
Caption = "Looking for Files"
ClientHeight = 2160
ClientLeft = 2505
ClientTop = 2325
ClientWidth = 7110
ControlBox = 0 'False
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2160
ScaleWidth = 7110
ShowInTaskbar = 0 'False
Visible = 0 'False
Begin MSComctlLib.ProgressBar ScanProgress
Height = 255
Left = 120
TabIndex = 2
Top = 1400
Width = 5500
_ExtentX = 9710
_ExtentY = 450
_Version = 393216
Appearance = 1
End
Begin VB.CommandButton AbortScan
Cancel = -1 'True
Caption = "Cancel"
CausesValidation= 0 'False
Height = 375
Left = 2880
TabIndex = 1
Top = 1760
Width = 1455
End
Begin VB.Label Label6
Caption = "X / Y"
Height = 195
Left = 5760
TabIndex = 7
Top = 1430
Width = 1200
End
Begin VB.Label Label5
Caption = "Label5"
Height = 440
Left = 120
TabIndex = 6
Top = 120
Width = 6870
End
Begin VB.Label Label4
Caption = "Label4"
Height = 195
Left = 120
TabIndex = 5
Top = 995
Width = 1155
End
Begin VB.Label Label3
Caption = "Label3"
Height = 195
Left = 120
TabIndex = 4
Top = 680
Width = 1155
End
Begin VB.Label Label2
Caption = "Label2"
Height = 195
Left = 1395
TabIndex = 3
Top = 995
Width = 5595
End
Begin VB.Label Label1
Caption = "Label1"
Height = 195
Left = 1395
TabIndex = 0
Top = 680
Width = 5595
End
End
Attribute VB_Name = "ShowProgress"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Declare Function GetTickCount Lib "kernel32" () As Long
Private Const C_MIN_WAIT_TIME As Long = 0
Private Const C_MIN_UPDATE_TIME As Long = 100
Private g_SP_StartTime As Long
Private g_SP_LastUpdate As Long
Public g_SP_Abort As Boolean
Public g_SP_AllowOtherDLG As Boolean
Public Sub SP_Init(maxIndex As Long)
g_SP_Abort = False
g_SP_AllowOtherDLG = False
g_SP_StartTime = GetTickCount()
g_SP_LastUpdate = g_SP_StartTime
ShowProgress.Visible = False
ShowProgress.Caption = GetResString(PROGRESS_CAPTION)
Label3.Caption = GetResString(PROGRESS_PATH_LABEL)
Label4.Caption = GetResString(PROGRESS_FILE_LABEL)
Label5.Caption = GetResString(PROGRESS_INFO_LABEL)
ScanProgress.Max = maxIndex
ShowProgress.Top = frmWizard.Top + 3200
ShowProgress.Left = frmWizard.Left + 500
End Sub
Public Sub SP_UpdateProgress(curObject As String, curParent As String, _
curIndex As Long)
Dim currTicks As Long
currTicks = GetTickCount()
ScanProgress.value = curIndex
If (Not ShowProgress.Visible) Then
If (currTicks - g_SP_StartTime > C_MIN_WAIT_TIME) Then
ShowProgress.Visible = True
End If
End If
If (currTicks - g_SP_LastUpdate > C_MIN_UPDATE_TIME) Then
g_SP_LastUpdate = currTicks
Label1.Caption = curParent
Label2.Caption = curObject
Label6.Caption = "(" & str$(curIndex) & "/" & str$(ScanProgress.Max) & ")"
End If
End Sub
Private Sub AbortScan_Click()
g_SP_Abort = True
Label5.Caption = GetResString(PROGRESS_WAIT_LABEL)
AbortScan.Caption = GetResString(PROGRESS_ABORTING)
AbortScan.Enabled = False
End Sub
Private Sub Form_Deactivate()
If Not g_SP_AllowOtherDLG Then
ShowProgress.ZOrder (0)
End If
End Sub
|