Find all our projects in development below.
All source code is GNU General Public License (GPL)
Browsing QuickQuery HL Edition/TerminateWaitForm.frm (3.65 KB)
VERSION 5.00
Begin VB.Form TerminateWaitForm
BorderStyle = 1 'Fixed Single
Caption = "Waiting for Half-Life to terminate..."
ClientHeight = 1695
ClientLeft = 45
ClientTop = 435
ClientWidth = 6030
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Icon = "TerminateWaitForm.frx":0000
MaxButton = 0 'False
ScaleHeight = 1695
ScaleWidth = 6030
ShowInTaskbar = 0 'False
StartUpPosition = 1 'CenterOwner
Begin VB.Timer DurationTimer
Interval = 1000
Left = 720
Top = 1080
End
Begin VB.Timer PostWaitTimer
Enabled = 0 'False
Interval = 1
Left = 1200
Top = 1080
End
Begin VB.CommandButton Command1
Cancel = -1 'True
Caption = "Cancel"
Default = -1 'True
Height = 375
Left = 4560
TabIndex = 2
Top = 1200
Width = 1335
End
Begin VB.Frame Frame1
Caption = "Status"
Height = 855
Left = 120
TabIndex = 0
Top = 120
Width = 5775
Begin VB.Label lblDuration
Caption = "Duration: 0 seconds"
Height = 255
Left = 240
TabIndex = 1
Top = 360
Width = 4095
End
End
Begin VB.Image ImgClock
Height = 480
Left = 120
Picture = "TerminateWaitForm.frx":0442
Top = 1080
Width = 480
End
End
Attribute VB_Name = "TerminateWaitForm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public WithEvents pThread As VBThread.Thread
Attribute pThread.VB_VarHelpID = -1
Dim Sec As Integer
Dim Min As Integer
Dim Hrs As Long
Sub ThreadProgWait(DummyArgument As Variant)
ThreadWaitForProgram
End Sub
Private Sub Command1_Click()
Unload Me
End Sub
Private Sub DurationTimer_Timer()
Sec = Sec + 1
If Sec > 59 Then
Min = Min + 1
Sec = 0
End If
If Min > 59 Then
Hrs = Hrs + 1
Min = 0
End If
lblDuration.Caption = "Duration: " & IIf(Hrs > 0, Hrs & " hour" & IIf(Hrs = 1, " ", "s "), "") & IIf(Min > 0, Min & " minute" & IIf(Min = 1, " ", "s "), "") & Sec & " second" & IIf(Sec = 1, "", "s")
End Sub
Private Sub Form_Load()
Set pThread = New VBThread.Thread
pThread.CreateWin32Thread Me, "ThreadProgWait"
Sec = 0
Min = 0
Hrs = 0
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
pThread.TerminateWin32Thread
Set pThread = Nothing
LaunchForm.ProgTerminated
End Sub
Private Sub Form_Resize()
On Error Resume Next
If WindowState = vbMinimized Then
MainForm.WindowState = vbMinimized
Hide
End If
End Sub
Private Sub PostWaitTimer_Timer()
PostWaitTimer.Enabled = False
Unload Me
End Sub
Private Sub pThread_OnThreadCreateFailure()
MsgBox "Unable to create thread.", vbCritical
PostWaitTimer.Enabled = True
End Sub
Download QuickQuery HL Edition/TerminateWaitForm.frm