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

Z

zapazap

-- 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/d...uttonreference/buttonmessages/bm_getcheck.asp
[2] http://msdn.microsoft.com/library/d...boxreference/comboboxmessages/cb_getcount.asp
[3] http://msdn.microsoft.com/library/d...mmctls/listview/messages/lvm_getitemcount.asp
[4] http://msdn.microsoft.com/library/d...rm/commctls/tab/messages/tcm_getitemcount.asp
 
T

Thomas Heller

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

Thomas
 
M

Mark Hammond

zapazap said:
For the "List-View" and "Tab" controls then, I expected to find the
constants

win32con.LVM_GETCHECK
win32con.TCM_GETITEMCOUNT

FYI, A good source of sample code for working with tree-view controls
can be found in the SpamBayes project, specifically:
http://cvs.sourceforge.net/viewcvs....ook2000/dialogs/FolderSelector.py?view=markup

Working with these win32gui structures is a complete PITA (as it needs
to be done via the 'struct' module) - I'd like to integrate support for
ctypes structures to make this more readable. In fact, I'd love to see
ctypes structure support as a standard library module, but that is for
another thread in a another forum <wink>

Mark
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top