Solved

Allowing application to finish before shutdown completes

Posted on 2001-06-22
5
146 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 8

Accepted Solution

by:
Dave_Greene earned 100 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

Suggested Solutions

Title # Comments Views Activity
bit defender blocks good applications 2 119
MS Access 03, TransferText, decimal places 8 92
Automatic Email Reminder 4 94
Userform to show a range in excel. 3 34
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

752 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