title: Can I use the win32 Setup API to detect when USB devices have been plugged-in or unplugged?
body: <p>I'm looking through the references at <a href="http://msdn.microsoft.com/en-us/library/aa376947%28v=vs.85%29.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/aa376947(v=vs.85).aspx</a> (Setup API reference) and <a href="http://msdn.microsoft.com/en-us/library/windows/hardware/ff549791%28v=vs.85%29.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/windows/hardware/ff549791(v=vs.85).aspx</a> (driver Setup API reference) and I don't see a function that would let me register a function that would get called when a particular device/hardwareID/driver key/ or whatever appears.</p>
  
  <p>Anyone know how I would go about this? Ideally I'd like to do this detection in user-space, but if necessary I could work things around detecting this in kernel-space.</p>