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