troubleshooting Question

Detect a Windows Operating system Shut Down

Avatar of EasyAim
EasyAim asked on
Visual Basic Classic
10 Comments1 Solution801 ViewsLast Modified:
I have a VB6 application which I wrote for a client that runs as a service in the background.  (It detects FTP file pushes and processes the information.)

PROBLEM:  The "unprofessional" looking problem is that whenever this server is re-booted or shut down for any reason, a dialog box appears saying that my program "Is not responding" and it gives a progress bar showing that the system is waiting around for it to end.

I know that the problem is caused by my application which is running on a timer.  (There are no forms in my application: I am using the "SetTimer()" API function.)

I'm assuming there's an API function to detect a pending Windows shutdown event.    

QUESTION:  What is the miracle API function that will tell me that the Windows operating system is trying to shutdown?    Or is there some other workaround?

NOTE:  This application which I wrote has no forms.  Solutions that involve form and closing all forms, etc... are not applicable to this problem.


Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 10 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 10 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros