This article describes my C class called DriveDetector which will allow your program to receive a notification when a removable drive (such as a flash. I have seen some examples on how to use RegisterDeviceNotification from the Windows API, but I have not seen any.NET examples. I want to write a C app that is. Working with USB devices in.NET and C. must register its interest in such events by sending its main window handle to RegisterDeviceNotification. C Signature: [DllImport( user32.dll , SetLastError = true)] static extern IntPtr RegisterDeviceNotification(IntPtr hRecipient, IntPtr NotificationFilter, uint Flags); Hi all, 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. HDEVNOTIFY hDevNotify = RegisterDeviceNotification(this- GetSafeHwnd(), amp;. Wripte a nice little CLR-library, reference and use it in C. Registering for Device Notification. // RegisterDeviceNotification also allows a service handle be used, // so a similar wrapper function to this one. HDEVNOTIFY WINAPI RegisterDeviceNotification. Services can use the RegisterDeviceNotification function to register to receive device notifications. USB RegisterDeviceNotification.NET Framework Forums. I've been doing lots of research on controlling USB devices in C and ran across a few tutorials that seemed. Check for device change (add/remove) events. (dbi, buffer, true); notificationHandle = RegisterDeviceNotification. Receive notification in C app when a.