Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Allowing application to finish before shutdown completes

Posted on 2001-06-22
5
Medium Priority
?
151 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 400 total points
ID: 6220024
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
ID: 6220035
That will pause the shutdown process long enough to let my program complete?

-M
0
 
LVL 8

Expert Comment

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

Author Comment

by:MELeBlanc
ID: 6220076
Works like a charm... thankee sir!

-M
0
 
LVL 8

Expert Comment

by:Dave_Greene
ID: 6220089
Welcomeee  :)
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

885 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