if(message->message == WM_DEVICECHANGE)
{
/*if (message->wParam == DBT_DEVICEARRIVAL || message->wParam == DBT_DEVICEREMOVECOMPLETE)
{
PDEV_BROADCAST_HDR pHeader = (PDEV_BROADCAST_HDR)message->lParam;
if (pHeader->dbch_devicetype == DBT_DEVTYP_DEVICEINTERFACE)
{
hotplug_onSystemDeviceChanged();
}
}*/
//DBT_DEVNODES_CHANGED:: The system broadcasts the DBT_DEVNODES_CHANGED device event when a device has been added to or removed from the system.
//Applications that maintain lists of devices in the system should refresh their lists.
if (message->wParam == DBT_DEVNODES_CHANGED && message->lParam == 0)
{
hotplug_onSystemDeviceChanged();
}
}
时间: 2024-11-23 09:23:39