#include #include #include #include bool DeviceNotification::registerDeviceNotification(GUIWindow &guiWindow) { DEV_BROADCAST_DEVICEINTERFACE filterData; ::memset(&filterData,0,sizeof(filterData)); filterData.dbcc_size=sizeof(filterData); filterData.dbcc_devicetype=DBT_DEVTYP_DEVICEINTERFACE; filterData.dbcc_classguid=AM_KSCATEGORY_CAPTURE; mhDevNotify=::RegisterDeviceNotification(guiWindow,&filterData,DEVICE_NOTIFY_WINDOW_HANDLE); return isOkay(); } void DeviceNotification::unRegisterDeviceNotification() { if(!isOkay())return; ::UnregisterDeviceNotification(mhDevNotify); mhDevNotify=0; }