[python-win32] determining information about a window

Tim Roberts timr at probo.com
Tue Aug 11 18:41:23 CEST 2009


Eric Blade wrote:
>> As a human being, how would you decide which one you need?
>>
>> That sounds flippant, but I'm being serious.  If you can describe the
>> decision-making process you would go through, then I think we can help
>> you create a program that does the same thing.
>>     
>
> What I need is a function that will tell me some sort of information
> about the window, except that I haven't got the slightest idea what is
> actually available to me to do that, or what information is available.
>  I'm sure that the operating system knows something about the window
> (like, one has titlebars, and one doesn't) that i can't see from just
> looking at a task list - but i don't know what i want, or how to get
> it.  Am I making sense?  I am in my head, but I don't know about
> anyone else's.
>   

You didn't really answer the question.  You can query virtually any
attribute of the window that you imagine: title, class, size, presence
of title bar, presence of close box, stretchable border, how many child
windows it has, contents of child windows, menu bar contents, etc.  Some
of this comes from APIs that send messages (like GetWindowText), some
from the data structures (GetWindowLong, GetClassLong), some from
enumerations (EnumChildWindows), and so on.

So, if you can tell us how YOU would tell the difference, we can suggest
which APIs you can use to find those attributes.

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



More information about the python-win32 mailing list