Solved

Allowing application to finish before shutdown completes

Posted on 2001-06-22
5
140 Views
Last Modified: 2010-05-02

Here is the scenario...

I have an application that runs in the tray that needs to updates a data file as it unloads.  Since this application runs on startup, it also needs to be able to finish it's "cleanup" before the machine actually finsihes a controlled shutdown.

Is there a clean way to do this?

-M
0
Comment
Question by:MELeBlanc
  • 3
  • 2
5 Comments
 
LVL 8

Accepted Solution

by:
Dave_Greene earned 100 total points
Comment Utility
Something like this... check the unloadmode

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
  If UnloadMode = vbAppWindows Then
     'finish processing here
  End If
End Sub
0
 
LVL 6

Author Comment

by:MELeBlanc
Comment Utility
That will pause the shutdown process long enough to let my program complete?

-M
0
 
LVL 8

Expert Comment

by:Dave_Greene
Comment Utility
yes, it will not terminate until the processing is complete.
0
 
LVL 6

Author Comment

by:MELeBlanc
Comment Utility
Works like a charm... thankee sir!

-M
0
 
LVL 8

Expert Comment

by:Dave_Greene
Comment Utility
Welcomeee  :)
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now