How to SendMessage to a SysListView32 control for selecting an item?

=?GB2312?B?0vzP6cH6?= yinxianglong at gmail.com
Sun Sep 17 13:05:09 CEST 2006


Hi, all:
     I am writing a python script, which controls a SysListView32 Control.
But I can't select an item by sendMessage using win32gui.

     My code as following:

import winGuiAuto
import win32gui
import commctrl

wn = win32gui
wga = winGuiAuto
hwnd = wn.FindWindow("#32770", "window title") #get the handle of the window

listView = wga.findControls(hwnd, wantedClass="SysListView32")[0] #get the
handle of the listview control

# I can't sendmessage by the next line
print wn.SendMessage(listView, commctrl.LVM_SETSELECTIONMARK, 0 ,0)

Thanks in advance!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-list/attachments/20060917/a024a6ff/attachment.htm 


More information about the Python-list mailing list