[python-win32] How to make Python identify GUI buttons by their label

Tim Roberts timr at probo.com
Fri Nov 12 00:18:02 CET 2010


ChristopherTom wrote:
> The contractor we hired told us that Python can only recognize GUI objects,
> specifically buttons, by their ID. This is very inconvenient and hard to
> work with as the button IDs change a lot between builds. Instead, I want to
> reference a button by its label like "Save", "Preview", or "Submit." Does
> anyone know how I can accomplish this?

I can't tell what this means.  Are you poking through another
application's window?  Typically, control IDs don't change that often. 
What do you mean by "recognize"?  Anything you can do from a C
application can be done from Python.  If you are searching for
subwindows, you can call the FindWindow API, which accepts titles.

-- 
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the python-win32 mailing list