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

尹祥龙 yinxianglong at gmail.com
Sun Sep 17 07:05:09 EDT 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.html>


More information about the Python-list mailing list