Results 1 to 2 of 2

Thread: I have an application that stops shutdown.

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2000
    Location
    Southern NH
    Posts
    2
    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.

  2. #2
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,177
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width