24 lines
690 B
C++
24 lines
690 B
C++
#include <dvcap/DeviceNotify.hpp>
|
|
#include <com/com.hpp>
|
|
#include <common/dxsdk.hpp>
|
|
#include <common/dbt.hpp>
|
|
|
|
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;
|
|
}
|