[python-win32] Help needed : FindWindowEx

Jerry Hill malaclypse2 at gmail.com
Thu May 3 20:35:55 CEST 2007


On 5/3/07, Tim Roberts <timr at probo.com> 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


More information about the Python-win32 mailing list