title: Detect iPhone using WMI in C#
body: <p>I'm using the following code to detect a USB device when it's connected to the computer:</p>
  
  <pre><code>private ManagementEventWatcher m_watcher;
  try
      {
          string queryString =
            "SELECT * " +
            " FROM __InstanceCreationEvent " +
            " WITHIN " + pollingInterval +
            " WHERE TargetInstance ISA 'Win32_USBHub'";
  
          EventQuery processQuery = new EventQuery(queryString);
          ManagementScope scope = new ManagementScope("root\\CIMV2");
          scope.Options.EnablePrivileges = true;
  
          m_watcher = new ManagementEventWatcher(scope, processQuery);
          m_watcher.EventArrived += new System.Management.EventArrivedEventHandler(EventArrived);
          m_watcher.Start();
      }
  
  private void EventArrived(object sender, EventArrivedEventArgs e)
  {
      var instance = ((PropertyData)(e.NewEvent.Properties["TargetInstance"]));
      var obj = (ManagementBaseObject)instance.Value;
      var args = new InsertEventArgs();
  
      var description = (string)obj.Properties["Description"].Value;
      var deviceId = (string) obj.Properties["DeviceID"].Value;
      var status = (string) obj.Properties["Status"].Value;
  </code></pre>
  
  <p>This works correctly when i attach a usb-key and a Samsung mobile phone. When I attach an iPhone, the <code>EventArrived</code> function is never hit. Am I using a wrong event? What am i doing wrong?</p>