On 5/3/07, Tim Roberts <[EMAIL PROTECTED]> wrote: > Oh, there is. You can watch for the WM_DEVICECHANGE message, which > fires every time there is a plug-and-play event. Once you get that > message, you can go enumerate the devices in your device class using the > SetupDi APIs to see if you are present.
Googling for the words WM_DEVICECHANGE and Python leads to the following bit of code posted by Tim Golden to c.l.py back in 2004: http://mail.python.org/pipermail/python-list/2004-January/245358.html I don't have a USB device to test with, but it does properly detect the insertion of a CDROM. At the very least it should serve as an example of how to get WM_DEVICECHANGE notifications in python on win32. -- Jerry _______________________________________________ Python-win32 mailing list Python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32