-
February 26th, 2009, 02:39 AM
#1
process dieng
hi,
how i can know if the process die normally or abnormally in c#(if there is boolen variable in c# to it)?
-
February 26th, 2009, 05:30 AM
#2
Re: process dieng
Have you tried the System.Management (WMI)?
Event handler:
Code:
private void EventArrived(object source, EventArrivedEventArgs e)
{
// TODO
}
Start monitoring:
Code:
WqlEventQuery query = new WqlEventQuery(
@"SELECT *
FROM __InstanceDeletionEvent WITHIN 1
WHERE TargetInstance ISA 'Win32_Process'");
_watcher = new ManagementEventWatcher();
_watcher.Query = query;
_watcher.EventArrived += new EventArrivedEventHandler(EventArrived);
_watcher.Start();
Stop monitoring:
HTH
Busy
-
February 26th, 2009, 11:01 AM
#3
Re: process dieng
In the process itself, or from another process?
- Make it run.
- Make it right.
- Make it fast.
Don't hesitate to rate my post.
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
|