Hello, I'm trying to use the function RegisterDeviceNotification to handle when a USB device attaches or removes. I have made my own class, CUSB, which. C++/MFC - RegisterDeviceNotification fails Discussion in 'Webmastering & Programming' started by Nevermind. HDEVNOTIFY DevHandle = RegisterDeviceNotification. Detecting USB Insertion / Removal Events in Windows using. know if RegisterDeviceNotification will be of. to detect USB insertion/removal events with C++? Receiving Device Event Notification in Windows Service(Detecting Hardware Insertion and/or Removal in Service) C++. Copy. HDEVNOTIFY. HDEVNOTIFY WINAPI RegisterDeviceNotification. Services can use the RegisterDeviceNotification function to register to receive. I currently have some code that sets up notifications of connected USB HID devices within a Windows Service (written in C++). The code is as follows: GUID hidGuid. Registering for Device Notification. C++. Copy. include. // RegisterDeviceNotification also allows a service handle be used, // so a similar. hardware add/remove with WM_DEVICECHANGE and RegisterDeviceNotification(); Author. C / C++ / MFC . Detecting Hardware Insertion and/or Removal I am calling function in C++ DLL to list all the USB's. In native code you would call RegisterDeviceNotification() and handle WM_DEVICECHANGE messages. How to retrieve dbcc_name from DEV_BROADCAST. I am trying to get the name of display device pluged in from the RegisterDeviceNotification that I've.