Beispiel #1
0
        public ChooseForm ()
        {
            InitializeComponent ();

            processView.ListViewItemSorter = new ProcessViewItemComparer ();
            usbDevView.ListViewItemSorter = new DeviceViewItemComparer ();

            processViewUpdater = new ProcessViewUpdater (processView);
            usbViewUpdater = new UsbViewUpdater (usbDevView);

            WqlEventQuery startQuery = new WqlEventQuery ();
            startQuery.EventClassName = "Win32_ProcessStartTrace";

            WqlEventQuery stopQuery = new WqlEventQuery ();
            stopQuery.EventClassName = "Win32_ProcessStopTrace";

            ManagementEventWatcher w = new ManagementEventWatcher (startQuery);
            w.EventArrived += new EventArrivedEventHandler (ProcessEventArrived);
            w.Start();
            processStartWatcher = w;

            w = new ManagementEventWatcher (stopQuery);
            w.EventArrived += new EventArrivedEventHandler (ProcessEventArrived);
            w.Start ();
            processStopWatcher = w;
        }
Beispiel #2
0
        public ChooseForm()
        {
            InitializeComponent();

            processView.ListViewItemSorter = new ProcessViewItemComparer();
            usbDevView.ListViewItemSorter  = new DeviceViewItemComparer();

            processViewUpdater = new ProcessViewUpdater(processView);
            usbViewUpdater     = new UsbViewUpdater(usbDevView);

            WqlEventQuery startQuery = new WqlEventQuery();

            startQuery.EventClassName = "Win32_ProcessStartTrace";

            WqlEventQuery stopQuery = new WqlEventQuery();

            stopQuery.EventClassName = "Win32_ProcessStopTrace";

            ManagementEventWatcher w = new ManagementEventWatcher(startQuery);

            w.EventArrived += new EventArrivedEventHandler(ProcessEventArrived);
            w.Start();
            processStartWatcher = w;

            w = new ManagementEventWatcher(stopQuery);
            w.EventArrived += new EventArrivedEventHandler(ProcessEventArrived);
            w.Start();
            processStopWatcher = w;
        }