title: Get friendly name of a device from WM_DEVICECHANGE LParam
body: <p>So i'm building an app for a school PC that tracks all inserted devices.
  I managed to use <code>RegisterDeviceNotification()</code> to get a notification in the main thread whenever i plug in or remove a device.
  All i can get though, is the <code>LParam</code>, a pointer that is device unique.</p>
  <p>I can't find anything about how to get the friendly name of the device using that LParam.
  The only resource i can find is <a href="https://www.codeproject.com/Articles/14500/Detecting-Hardware-Insertion-and-or-Removal" rel="nofollow noreferrer">this</a> CodeProject from 2006 (in C++).</p>
  <p>I can't find anything on pinvoke.net and the only thing i found (i don't remember exactly where) is using  a <code>ManagementObjectSearcher</code> to get this data, but it finds null data. (here's the code)</p>
  <pre><code>ManagementObjectSearcher searcher = new ManagementObjectSearcher(&quot;Select Name from Win32_PnpEntity&quot;);
  
              foreach (ManagementObject devices in searcher.Get())
              {
                  foreach (var v in devices.Properties)
                  {
                      Console.WriteLine(v.Value);
                  }
              }
  
              searcher.Dispose();
  </code></pre>
  <p>Can anyone please help me figure out how to get the friendly name of the device?</p>