-- Pythonic control of Windows GUI application: tabs and listviews

Thomas Heller theller at python.net
Mon Jan 26 04:43:17 EST 2004


zapazap at yahoo.com (zapazap) writes:

> -- Pythonic control of Windows GUI application: tabs and listviews
>
> Dear Snake-charming Gurus,
>
> I have learned to manipulate some controls ("Button", "ComboBox", etc)
> through such means as:
>
>     win32gui.SendMessage(hwnd, win32con.BM_GETCHECK, 0 ,0)
>     win32gui.SendMessage(hwnd, win32con.CB_GETCOUNT, 0 ,0)
>
> provided by Python Win32 Extensions, and understand that such
> constants as:
>
>     win32con.BM_GETCHECK
>     win32con.CB_GETCOUNT
>
> corresponding to distinct messages (documented at [1] and [2]) that
> can be sent to such controls.
>
> For the "List-View" and "Tab" controls then, I expected to find the
> constants
>
>     win32con.LVM_GETCHECK       
>     win32con.TCM_GETITEMCOUNT   
>
> corresponding to the distinct messages documented at [3] and [4]. 
> Unfortunately the module win32com module does not have any LVM_* or
> TCM_* attributes, and I have not found reference to such constants in
> the Extensions documentation.

These constants are defined in the 'commctrl' module:

Python 2.3.3 (#51, Dec 18 2003, 20:22:39) [MSC v.1200 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import commctrl
>>> commctrl
<module 'commctrl' from 'C:\Python23\lib\site-packages\win32\lib\commctrl.pyc'>
>>> commctrl.LVM_GETITEMCOUNT
4100
>>> commctrl.TCM_GETITEMCOUNT
4868

Thomas



More information about the Python-list mailing list