def selectListboxItem(hwnd, item):
'''Selects a specified item in a list box control.
Arguments:
hwnd Window handle of the required list box.
item The reqired item. Either an index, of the text of the
required item.
Usage example: TODO
'''
try: # item is an index Use this to select
0 + item
win32gui.SendMessage(hwnd, win32con.LB_SETCURSEL, item, 0)
_sendNotifyMessage(hwnd, win32con.LBN_SELCHANGE)
except TypeError: # Item is a string - find the index, and use that
items = getListboxItems(hwnd)
itemIndex = items.index(item)
selectListboxItem(hwnd, itemIndex)
winGuiAuto_bak.py 文件源码
python
阅读 20
收藏 0
点赞 0
评论 0
评论列表
文章目录