阅读:2312回复:2
摄像头检测不到插入和移除
USB 摄像头侦测问题
不知道为什么,U盘能侦测到插入和移除, USB 摄像头就是不行,谁给帮忙解答一下 GUID CAMERA = { 0x6BDD1FC6, 0x810F, 0x11D0, 0xBE, 0xC7, 0x08, 0x00, 0x2B, 0xE2, 0x09, 0x2F }; DEV_BROADCAST_DEVICEINTERFACE NotificationFilter; ZeroMemory( &NotificationFilter, sizeof(NotificationFilter) ); NotificationFilter.dbcc_size = sizeof(NotificationFilter); NotificationFilter.dbcc_devicetype=DBT_DEVTYP_DEVICEINTERFACE; NotificationFilter.dbcc_classguid=CAMERA; RegisterDeviceNotification(hWnd,&NotificationFilter, DEVICE_NOTIFY_WINDOW_HANDLE); 侦测: if( message == WM_DEVICECHANGE ) { if ( wParam==DBT_DEVNODES_CHANGED ) int kk=1; else if ( wParam == DBT_DEVICEARRIVAL) // device arrival { MessageBox(NULL,"arrival","test",MB_OK); return 1; } else if (wParam == DBT_DEVICEREMOVECOMPLETE) // device remove { MessageBox(NULL,"remove","test",MB_OK); return -1; } } |
|
沙发#
发布于:2010-05-01 22:24
帮你沙发下。
|
|
|
板凳#
发布于:2010-05-01 22:32
RegisterDeviceNotification(hWnd,&NotificationFilter, DEVICE_NOTIFY_WINDOW_HANDLE);
会不会有问题? 可以hook IRP试试。 |
|
|