C Signature: [DllImport( user32.dll , SetLastError = true)] static extern IntPtr RegisterDeviceNotification(IntPtr hRecipient, IntPtr NotificationFilter, uint Flags); Working with USB devices in.NET and C. must register its interest in such events by sending its main window handle to RegisterDeviceNotification. C , F . HDEVNOTIFY WINAPI RegisterDeviceNotification. Services can use the RegisterDeviceNotification function to register to receive. 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. Capturing Device Events in a C Windows Service. we will register for device notifications by using the Win32 API function RegisterDeviceNotification. Registering for Device Notification. // RegisterDeviceNotification also allows a service handle be used, // so a similar wrapper function to this one. Using RegisterDeviceNotification in a.NET app. up vote 3 down vote favorite. 1. Can anyone give me a sample of how to use RegisterDeviceNotification in C . 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. 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.