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

zapazap zapazap at yahoo.com
Mon Jan 26 02:06:49 CET 2004


-- 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.


I want to control a windows app through the GUI, but I do *not* want
to resort to 'mouseclick/keypress recorder' type tools.  For now, I
seem to be able to work the Button and Combobox controls for a target
window while another window is running full screen mode, and I want to
keep it that way.  But some of the controls I need can be reached only
by mamipulating Tab and Listview controls.

Do you have any advice on how I might control these controls in a way
similar to my controling Buttons and Comboboxes?  Or, failing that, do
you have an entirely different route for me controlling one app while
a second is running maximized?

Much thanks!!
- Bryan Hann
 

[1] http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/buttons/buttonreference/buttonmessages/bm_getcheck.asp
[2] http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/comboboxes/comboboxreference/comboboxmessages/cb_getcount.asp
[3] http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/listview/messages/lvm_getitemcount.asp
[4] http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/tab/messages/tcm_getitemcount.asp



More information about the Python-list mailing list