Using PnP Hardware Profile Change Notification
A driver registers for EventCategoryHardwareProfileChange notification so the driver can be notified when the machine transitions from one hardware profile to another. For example, a driver can use this mechanism to be notified when a laptop is docked or undocked.
The following subsections discuss how to register for hardware profile change notification and how to handle hardware profile change events in a PnP notification callback routine: