检测USB设备的拔插信息
1.在BOOL CUsbHid123Dlg::OnInitDialog(){}中注册设备
DEV_BROADCAST_DEVICEINTERFACE DevInt;
memset(&DevInt,0,sizeof(DEV_BROADCAST_DEVICEINTERFACE));
DevInt.dbcc_size = sizeof(DEV_BROADCAST_DEVICEINTERFACE);
DevInt.dbcc_devicetype = DBT_DEVTYP_DEVICEINTERFACE;
DevInt.dbcc_classguid = USB;//usb设备的GUID
RegisterDeviceNotification(this->m_hWnd,&DevInt, DEVICE_NOTIFY_ALL_INTERFACE_CLASSES);
2.BOOL CUsbHid123Dlg::OnDeviceChange(UINT nEventType, DWORD dwData)
{
DEV_BROADCAST_DEVICEINTERFACE* dbd = (DEV_BROADCAST_DEVICEINTERFACE*) dwData;
PDE