Python-UIAutomation-for-Windows icon indicating copy to clipboard operation
Python-UIAutomation-for-Windows copied to clipboard

uiautomation多线程问题

Open hustcxc opened this issue 2 years ago • 4 comments
trafficstars

如果我想新起一个线程监控概率性弹窗,应该怎么使用uiautomation才能避免线程冲突呢?

hustcxc avatar Dec 20 '22 13:12 hustcxc

在新开的线程中需要进行初始化 ua.InitializeUIAutomationInCurrentThread()

zhouxihong1 avatar Jan 05 '23 09:01 zhouxihong1

有可能結合multiprocessing和uiautomation?

zmh00 avatar Jan 08 '23 15:01 zmh00

demos/uiautomation_in_thread.py

yinkaisheng avatar Mar 22 '23 15:03 yinkaisheng

可以用一个线程锁来分配键盘鼠标的控制权, 避免线程之间对键鼠控制权产生冲突. 但是我用线程方法实现了弹窗监视器之后, 发现在低端机型上运行一段时间, 会出现线程卡死在寻找控件方法里的情况.

mowen0107 avatar Jun 02 '23 12:06 mowen0107