Applications can use the RegisterDeviceNotification function to. Registering for Device Notification. // This GUID is for all USB. Detecting USB Drive Removal in a C Program. Jan Dolinay, 8 Nov 2007 CPOL 4.87 (115 votes) 1: 2: 3: 4: 5: 4. HDEVNOTIFY RegisterDeviceNotification. (USB) is attacted or removed. C Signature: [DllImport( user32.dll , SetLastError = true)] static extern IntPtr RegisterDeviceNotification(IntPtr hRecipient, 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. I am writing a C class library for a WPF application. The class library should raise an event whenever some USB device is plugged in/plugged out. I am. How to Detect the Connection and Removal of USB. function called RegisterDeviceNotification which. Copyright © 2010 Future Technology Devices International. USB RegisterDeviceNotification.NET Framework Forums on Bytes. Need help? Post your question and get tips & solutions from a community of 420,345 IT Pros. HDEVNOTIFY WINAPI RegisterDeviceNotification. Services can use the RegisterDeviceNotification function to register to receive device notifications. Check for device change (add/remove) events. // USB devices private static. (dbi, buffer, true); notificationHandle = RegisterDeviceNotification. Hi want drive letter of any driver being hotplugged and removed. like usb,esata.firewire etc. i have called RegisterDeviceNotification in service and getting.