From: Tim R. <ti...@pr...> - 2008-10-17 17:40:40
|
junk mail wrote: > > I'd like to know if its possible to register my application for device > remove/insert event. > If it's not possible, then please give me a hint how to handle these > events with minimal code/proc usage. You don't really have to say "minimal code/proc usage". No one is really going to make a suggestion that involves a whole bunch of unnecessary calls. However, many things in the Win32 API are rather tedious. This is no exception. The function you need is RegisterDeviceNotification. You can tell it the GUID of the device class you want to monitor, or give a device interface GUID instead, if you know it. Your window will then get WM_DEVICECHANGE messages when the state of any device in that class changes. It's up to you to then figure out whether it was your device that changed state. It's usually pretty easy to detect device removal, because your libusb requests will start to fail. > Sorry to bother you with my question i just didn't know any better > place to post it. > Kind of hard to use usblib for a beginner like me without proper > documentation. Be careful how you put that. The documentation is quite proper. It doesn't hold your hand through every possible beginning step, in part because libusb is a low-level library. You are essentially writing a device driver, and you are expected to be able to figure out many things on your own. > Ohh and btw: where can i post my noobie questions about libusb, is > there a forum/mailing list for that? This is as good a place as any for libusb questions. However, there is a separate mailing list for libusb-win32 questions. https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel -- Tim Roberts, ti...@pr... Providenza & Boekelheide, Inc. |