[python-win32] Help needed : FindWindowEx
Tim Roberts
timr at probo.com
Thu May 3 19:46:06 CEST 2007
Simon Dahlbacka wrote:
> Random thought.. there *has* to be a better way of finding out when a
> usb device is plugged in...
>
> (not that I know how, but I haven't needed to find out either..)
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.
Now, how does all that map to Python? With difficulty, I imagine.
--
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.
More information about the Python-win32
mailing list