Re: Preventing End Task
From: Steve Gerrard (mynamehere_at_comcast.net)
Date: 01/06/05
- Next message: Steve Gerrard: "Re: Preventing End Task"
- Previous message: Alan McFarlane: "Re: SSM Multicast availablity"
- Next in thread: Steve Gerrard: "Re: Preventing End Task"
- Maybe reply: Steve Gerrard: "Re: Preventing End Task"
- Maybe reply: Martin Trump: "Re: Preventing End Task"
- Maybe reply: Jim Y: "Re: Preventing End Task"
- Maybe reply: Jim Y: "Re: Preventing End Task"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 6 Jan 2005 07:40:35 -0800
"Suja" <sujamoljames@yahoo.com> wrote in message
news:1105015271.118546.109890@f14g2000cwb.googlegroups.com...
| Hi All,
|
| I have a process listed in Task Manager. When the user do End Task, i
| want to prevent this.
|
| I am not planning to move this process as a service due to technical
| constrains ( Admin Rights issue)
|
| 1) Alleast I need to show a error message like " Crtical process can't
| terminate" same as winlogon.exe
| 2) How to hide my exe from task manager?
|
|
| Thanks in advance
| Suja
|
Assuming you have a main form for your app, put a handler in the query
unload event of the main form:
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
The UnloadMode value will tell you why the form is being unloaded:
vbFormControlMenu
The user chose the Close command from the Control menu on the form.
vbFormCode
The Unload statement is invoked from code.
vbAppWindows
The current Microsoft Windows operating environment session is
ending.
vbAppTaskManager
The Microsoft Windows Task Manager is closing the application.
vbFormMDIForm
An MDI child form is closing because the MDI form is closing.
vbFormOwner
A form is closing because its owner is closing.
You can do a select case on UnloadMode if you need different responses.
You can then pop up a message to the user, and set Cancel = True if you
(or they) want to cancel the unload operation.
In some cases, i.e. the session is ending, Windows may close the
application anyway, but at least you can warn the user this way.
- Next message: Steve Gerrard: "Re: Preventing End Task"
- Previous message: Alan McFarlane: "Re: SSM Multicast availablity"
- Next in thread: Steve Gerrard: "Re: Preventing End Task"
- Maybe reply: Steve Gerrard: "Re: Preventing End Task"
- Maybe reply: Martin Trump: "Re: Preventing End Task"
- Maybe reply: Jim Y: "Re: Preventing End Task"
- Maybe reply: Jim Y: "Re: Preventing End Task"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|