[python-win32] Visibility information

Elias Fotinis efotinis at yahoo.com
Wed Jan 27 09:49:36 CET 2010


From: Stefan George

> I am using the PyWin32 package and I am wondering if there is any way to 
> get visibility information of a button (I only know the handle).
> Is that possible and is there any code snippet, you could pass to me?
>
> I am looking for something like isVisible(hwnd) returns True or False.

It's pretty simple:

    import win32gui
    button_handle = ...
    is_visible = win32gui.IsWindowVisible(button_handle)

The win32gui contains all GUI related Windows API functions.

PyWin32's help file is great for looking up Windows functions and their 
respective modules. Just switch to the Index tab, type the function name and 
you'll find a help page with the parameters, return type and containing 
module of each API function.



More information about the python-win32 mailing list