LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Recognizing when my CVI-programm is killed via taskmanager

Hi all,

 

I'm looking for a possibility to recognize when a user tries to kill my CVI-programm via the taskmanagers  "process"-tab.

I tried with "InstallMainCallback" and the "EVENT_END_TASK", but this event isn't fired if I kill the application with the taskmanager.

 

Any suggestions?

 

Thanks

 

Willi

0 Kudos
Message 1 of 2
(3,190 Views)

I've never been able to get the InstallMainCallback function to work well, I think others have had issues too.

 

But aside from that, if you kill the app as a process (second tab on task manager) there's no notification to the process, as the task manager warns in the confirm popup it gives you.  So there's no terminate message sent to the process by the OS.

 

On the other hand, if you kill it from the task manager as an application (first tab) notification is given and you (in theory) should see the OS issue an end message to the process.

 

If you had another process "watching" the CVI application that has a handle to the CVI process, it can tell when the CVI process  is terminated because the handle will become signaled.

 

But, unless there's a parent - child process relationship, it's hard to get a handle to another process - Windows is designed to make this difficult, to keep processes from easily interfering with each other.

0 Kudos
Message 2 of 2
(3,169 Views)