Initial
This commit is contained in:
23
dvcap/DeviceNotify.cpp
Normal file
23
dvcap/DeviceNotify.cpp
Normal file
@@ -0,0 +1,23 @@
|
||||
#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;
|
||||
}
|
||||
Reference in New Issue
Block a user