Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 152
  • Last Modified:

Allowing application to finish before shutdown completes


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
MELeBlanc
Asked:
MELeBlanc
  • 3
  • 2
1 Solution
 
Dave_GreeneCommented:
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
 
MELeBlancAuthor Commented:
That will pause the shutdown process long enough to let my program complete?

-M
0
 
Dave_GreeneCommented:
yes, it will not terminate until the processing is complete.
0
 
MELeBlancAuthor Commented:
Works like a charm... thankee sir!

-M
0
 
Dave_GreeneCommented:
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.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now