Get Hardware ID of connected device RRS feed

  • Question

  • HI 

    I Need connected device hardware id or other device information. Whenever I plug the USB mouse or USB speaker I get WM_DEVICECHANGE event and in wparam I get DBT_DEVNODES_CHANGED (7) and lparam as 0. Also I have used RegisterDeviceNotification  to register the USB device notifications. still I dont get device information in the lparam, again it has 0 (zero).

    Let me know where is the problem, here is the code used for the Register.

    Or Any other method to get Hardware id of the currently connected  (used) IO devices. 

    GUID InterfaceClassGuid= { 0xA5DCBF10L, 0x6530, 0x11D2, 0x90, 0x1F, 0x00, \
    0xC0, 0x4F, 0xB9, 0x51, 0xED };


    ZeroMemory(pFilterData, sizeof(DEV_BROADCAST_DEVICEINTERFACE));
    pFilterData->dbcc_size = sizeof(DEV_BROADCAST_DEVICEINTERFACE);
    pFilterData->dbcc_devicetype = DBT_DEVTYP_DEVICEINTERFACE;
    pFilterData->dbcc_classguid = InterfaceClassGuid;

        *hDeviceNotify = RegisterDeviceNotification( 
            hWnd,                       // events recipient
            pFilterData,        // type of device
            DEVICE_NOTIFY_WINDOW_HANDLE // type of recipient handle



    Friday, July 12, 2013 3:07 PM


All replies