2,640
社区成员
发帖
与我相关
我的任务
分享
static const GUID hid_guid = {0xb322bfc4, 0xe924, 0x11d2, 0x82, 0x6e, 0x00, 0x80, 0xc8, 0xef, 0x9f, 0x08};
DEV_BROADCAST_DEVICEINTERFACE dbi;
ZeroMemory(&dbi,sizeof(dbi));
dbi.dbcc_size=sizeof(dbi);
dbi.dbcc_devicetype = DBT_DEVTYP_DEVICEINTERFACE;
dbi.dbcc_reserved = 0;
dbi.dbcc_classguid = hid_guid;
HDEVNOTIFY hDevNotify;
hDevNotify = RegisterDeviceNotification(m_hWnd, &dbi, DEVICE_NOTIFY_WINDOW_HANDLE);
if(!hDevNotify)
{
int Err = GetLastError();
MessageBox("RegisterDeviceNotification failed");
}
OnDeviceChange(
UINT nEventType,
DWORD_PTR dwData
)