[python-win32] message queue

Tim Roberts timr at probo.com
Fri Oct 5 00:35:21 CEST 2007


Radu Ciora wrote:
> My goal is to be able to say when a user clicks a Word toolbar button to be able to "know" what that button was. So that I might provide some feedback or something.
>   

Unfortunately, that turns out to be virtually impossible.

Most applications draw their windows by putting up a collection of
controls within windows, so that each toolbar button (for example) is a
separate window.  The toolbar buttons in Office applications don't do
that.  For efficiency, they draw all of their toolbars into one big
bitmap.  If you use spyxx to look at Word's window structure, you'll see
that each toolbar and command bar is one big window, with no
subwindows.  So, although you could learn that the user clicked at
coordinate (223,17) of the "Standard" command bar, there is simply no
way to figure out what button was actually at that location.

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



More information about the python-win32 mailing list