|
-
February 22nd, 2000, 10:36 AM
#1
Trapping when exe is killed from Task Manager
How to deny the access to user from killing MFC dialog based application from
Task Manager (Terminate process) or atleast get notified when it is killed
You can mail to [email protected]
-
February 22nd, 2000, 12:03 PM
#2
Re: Trapping when exe is killed from Task Manager
Strange.... are you trying to develop something that prevents the owner of the machine/program from decide what should be running or not? Really weird indeed. I think that can't be done, anyway, have you seen it somewhere ?
Regarding "get notified when killed", i think Windows has a funny way to KILL processes. It just removes the thread without first sending KILL message to clean things nicely. So i guess you don't have a chance here either...
--
Nuno Tavares
http://nthq.cjb.net
Nuno Tavares
"I live the way I type: fast, with a lot of errors"
-
February 22nd, 2000, 12:07 PM
#3
Re: Trapping when exe is killed from Task Manager
I forgot to mentio that if it is a service, and it's installed by Administrator Priviledged User (WinNT only) it won't be killed by a common user.
--
Nuno Tavares
http://nthq.cjb.net
Nuno Tavares
"I live the way I type: fast, with a lot of errors"
-
February 24th, 2000, 12:01 AM
#4
Re: Trapping when exe is killed from Task Manager
I don't know if it works, but it might be a solution (maybe).
You have to make 2 applications:
-the first one(app1) has to do the following -launch the other application(app2)
-wait to finish (app2) and check a value returned by app2 (ex. if it is true app2 terminated normaly and if it is false app2 was killed)
An example of application who can launch another process and wait for it to finish you can find at codeguru.com but I don't remember the exact place.
The sad part is if the user kill app1.In this case I really don't know what to do.
Sorry for my bad english.
Ciprian Pavel.
Sincerily
Ciprian Pavel
-
February 24th, 2000, 12:04 AM
#5
Re: Trapping when exe is killed from Task Manager
I don't know if it works, but it might be a solution (maybe).
You have to make 2 applications:
-the first one(app1) has to do the following -launch the other application(app2)
-wait to finish (app2) and check a value returned by app2 (ex. if it is true app2 terminated normaly and if it is false app2 was killed)
An example of application who can launch another process and wait for it to finish you can find at codeguru.com but I don't remember the exact place.
The sad part is if the user kill app1.In this case I really don't know what to do.
Sorry for my bad english.
Sincerily
Ciprian Pavel
-
February 24th, 2000, 02:01 AM
#6
Re: Trapping when exe is killed from Task Manager
I think that getting "notified when it is killed" is an excellent solution. You can process the WM_CLOSE message, because the first thing that the task manager does is to send it, and I have verified that a dialog gets the message and can process the message. Hopefully in your WM_CLOSE message you will be able to do whatever cleanup is required. This is definitely the way it "should" be done. Note that you must get all the data you need to get from the dialog before calling CDialog::OnClose().
-
February 24th, 2000, 02:52 AM
#7
Re: Trapping when exe is killed from Task Manager
When applicaton is killed through Task Manager process tab using End Process option, application will not get any wm_close message. thats the problem i had? please if u have any other solution let me know [email protected]
-
February 24th, 2000, 01:24 PM
#8
Re: Trapping when exe is killed from Task Manager
I tested it and my dialog definitely got the close message. It works. However, I used the "End Process" on the "Applications" tab. That is what should be used when possible. The "Processes" tab should be used when the "Applications" tab cannot be used. When I used the "Processes" tab to terminate my dialog, the dialog did not get a close message.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|