Advertisement

07.22.2008 at 11:40AM PDT, ID: 23586094 | Points: 125
[x]
Attachment Details

Tring to capture when windows dock/undocks a laptop.

Asked by joseph-narissi in Miscellaneous Programming, Windows Programming, Signal Processing

Tags: dock undock

I have tried to get this work in C# and the event never gets caught. Here is my code:

        private ManagementEventWatcher _dockEvent;

        public Window1()
        {
            InitializeComponent();
                                   
            try
            {
                string query = "SELECT * FROM __InstanceOperationEvent WITHIN 1 WHERE TargetInstance ISA \"Win32_SystemEnclosure\"";
                _dockEvent = new ManagementEventWatcher(query);
                _dockEvent.EventArrived += new EventArrivedEventHandler(dockEvent_EventArrived);
                _dockEvent.Start();
            }
            catch (ManagementException ex)
            {
            }  
        }

 public void dockEvent_EventArrived(object sender, EventArrivedEventArgs e)
        {

}


Thanks.Start Free Trial
 
 
Loading Advertisement...
 
[+][-]07.22.2008 at 01:23PM PDT, ID: 22063274

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.22.2008 at 03:34PM PDT, ID: 22064325

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.23.2008 at 05:28AM PDT, ID: 22068398

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.23.2008 at 05:48AM PDT, ID: 22068607

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.23.2008 at 09:11AM PDT, ID: 22070787

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.23.2008 at 09:19AM PDT, ID: 22070865

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.23.2008 at 10:29AM PDT, ID: 22071670

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.23.2008 at 10:37AM PDT, ID: 22071778

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.11.2008 at 09:40AM PDT, ID: 22205904

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_Related_20080208