1. 程式人生 > >MFC中捕捉裝置插拔資訊

MFC中捕捉裝置插拔資訊

DEV_BROADCAST_DEVICEINTERFACE NotificationFilter;
 ZeroMemory( &NotificationFilter,sizeof(NotificationFilter) );
 NotificationFilter.dbcc_size = sizeof(DEV_BROADCAST_DEVICEINTERFACE);
 NotificationFilter.dbcc_devicetype = DBT_DEVTYP_DEVICEINTERFACE;
 NotificationFilter.dbcc_classguid = MyDevGuid;
 HDEVNOTIFY hDevNotify = RegisterDeviceNotification(this->GetSafeHwnd(),&NotificationFilter,