-
I have an application that stops shutdown of win98 se. The Application runs in the taskbar with a Do While Loop running for x amount of time. This Loop is active while Shutdown commences. I would like to know if there is a way to A. Test for shutdown, or B. Let shutdown close my taskbar program.
-
Put a call to DoEvents in the Loop, (this will allow other events to fire), then in have the loop exit if the time expires or a Boolean Flag is set, then set the Boolean Flag in the Forms QueryUnload Event, i.e.
Code:
Private bStopped As Boolean
Private Sub Form_Activate()
Dim tTimer As Single
tTimer = Timer
'Loop for 30 Seconds, or until the form is unloaded
While Not bStopped And (Timer - tTimer) < 30
Caption = Val(Caption) + 1
DoEvents
Wend
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
'Set the Boolean Flag to indicate to the Loop that it should Stop
bStopped = True
End Sub