Task Mgr message
-
Hi, If we close a window application in task manager using end process method, the applcation should get some message to close the window. Can anyone please tell me what message that window applcation will get from task manager? Thanks,
When an application is terminated using end process of task manager, the application is terminated externally. There is no message or event sent to the application. So there is no way that the application can know if such a thing is happening. Task Manager uses the
TerminateProcess
API with an exit code of1
to achieve this. So the only chance you have is to hook into theTerminateProcess
API.«_Superman_»
I love work. It gives me something to do between weekends. -
When an application is terminated using end process of task manager, the application is terminated externally. There is no message or event sent to the application. So there is no way that the application can know if such a thing is happening. Task Manager uses the
TerminateProcess
API with an exit code of1
to achieve this. So the only chance you have is to hook into theTerminateProcess
API.«_Superman_»
I love work. It gives me something to do between weekends. -
You shouldn't have the need to do this. Why do you want to do it. API hooking is not recommended by Microsoft and will not work properly from Vista onwards. Here are a few links on how it is done - Detours[^] API hooking revealed[^] API Hooking with MS Detours[^] Win32 API hooking: Another reason why it might not work[^]
«_Superman_»
I love work. It gives me something to do between weekends. -
You shouldn't have the need to do this. Why do you want to do it. API hooking is not recommended by Microsoft and will not work properly from Vista onwards. Here are a few links on how it is done - Detours[^] API hooking revealed[^] API Hooking with MS Detours[^] Win32 API hooking: Another reason why it might not work[^]
«_Superman_»
I love work. It gives me something to do between weekends. -
i need to send some information to server while client application crashes. So that only im asking.
Either hook TerminateProcess API or make it as your design limitation. Another way is to make a service or another application which will continuously monitor your client application and once it has been closed from Task Manager, that service or application should send signal to your server.
f
-
Either hook TerminateProcess API or make it as your design limitation. Another way is to make a service or another application which will continuously monitor your client application and once it has been closed from Task Manager, that service or application should send signal to your server.
f
-
You shouldn't have the need to do this. Why do you want to do it. API hooking is not recommended by Microsoft and will not work properly from Vista onwards. Here are a few links on how it is done - Detours[^] API hooking revealed[^] API Hooking with MS Detours[^] Win32 API hooking: Another reason why it might not work[^]
«_Superman_»
I love work. It gives me something to do between weekends.«_Superman_» wrote:
will not work properly from Vista onwards.
Why do you say it won't work from Vista onward? I have a hooking library that works just fine in Vista. I agree that IAT patching is a poor way to hook, however. The Detours way is far superior.
-
«_Superman_» wrote:
will not work properly from Vista onwards.
Why do you say it won't work from Vista onward? I have a hooking library that works just fine in Vista. I agree that IAT patching is a poor way to hook, however. The Detours way is far superior.
Sorry. That is what I meant. Should have been more specific there.
«_Superman_»
I love work. It gives me something to do between weekends. -
When an application is terminated using end process of task manager, the application is terminated externally. There is no message or event sent to the application. So there is no way that the application can know if such a thing is happening. Task Manager uses the
TerminateProcess
API with an exit code of1
to achieve this. So the only chance you have is to hook into theTerminateProcess
API.«_Superman_»
I love work. It gives me something to do between weekends.You'd have to hook it globally, something that's hard to do. Almost all hooking methods word within a process.
Steve
-
Hi, If we close a window application in task manager using end process method, the applcation should get some message to close the window. Can anyone please tell me what message that window applcation will get from task manager? Thanks,
As has been said, when a process is terminated it's killed with prejudice and receives no notifications. That's the purpose of
TerminateProcess
, to kill a process that's misbehaving and can't be trusted. Perhaps a better approach would be to use an external process to monitor the process in question.Steve