Solved

Task Manager End task

Posted on 2006-10-30
4
163 Views
Last Modified: 2013-12-03
Hi,

I have developed an application using D7 that monitors time used on the computer.
When a user uses Windows Task Manager to close my application while my application is in the running state (i.e. the status is not "Not responding", it is still "Running") does Windows send a message to my application that I can respond to and possibly cancel the close command.
I will be glad to have some information on this issue.

Thank you
0
Comment
Question by:martbase
  • 2
4 Comments
 
LVL 28

Accepted Solution

by:
TName earned 250 total points
ID: 17838109
0
 
LVL 28

Expert Comment

by:TName
ID: 17838177
You could also/additionally use a second small process that just checks regurarly if the main application is still running. Logging the status (e.g. every minute) would also be worth considering.
0
 

Author Comment

by:martbase
ID: 18034798
Thanks a lot TName,

I found the link to PAQ very helpful especially Madshi's solution which is quite elegant. My application is multi-threaded so I believe his solution will be perfect me. My only concern is that when the application gets terminated using Task manager, will the application handle in the call to "WaitForSingleObject(Application.Handle, INFINITE)" still be valid? Could I possibly get a working example that has already been tested. Also if the Application object is still valid I have this idea that I could relaunch the application since I can get its filename from the application object! Is there any danger in launching my application from one of its threads?
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

757 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

21 Experts available now in Live!

Get 1:1 Help Now