Hi,
I'm writing a C# application, this application will display a message when
USB device connected/disconnected(removed) , How can I do that ?
I made some research and find something called "RegisterDeviceNotification"
, But don't find how to use it in my C# since I should send to this API
"IntPtr hRecipient", How can I do that ?
[DllImport("user32.dll", SetLastError = true)]
static extern IntPtr RegisterDeviceNotification(IntPtr hRecipient,IntPtr
NotificationFilter, uint Flags);
I saw some example in C++ which do the following :
RegisterDeviceNotification(this->GetSafeHwnd(), &NotificationFilter,
DEVICE_NOTIFY_WINDOW_HANDLE);
How to do the same in C# ?????????????