[an error occurred while processing this directive]
|
Detecting USB devices inserted/removed from a software level[back to top]
QUESTION
Is there any way to detect the insertion/removal of a USB device programmatically in Windows 9x/NT, (e.g., through a callback mechanism)?
ANSWER
Yes. There is a means, but it is not a simple mechanism. Currently an app note to describe this process is being developed by Kosta Koeman along with code. The basic idea is that your application must monitor for a WM_DEVICECHANGE message with wParam == DBT_DEVNODES_CHANGED. You then need to check the number of your devices. If the number has changed, then you need to add an instance or check which instance needs to be removed.
E-mail: info@telesys.ru