yinkaisheng / Python-UIAutomation-for-Windows

🐍Python 3 wrapper of Microsoft UIAutomation. Support UIAutomation for MFC, WindowsForm, WPF, Modern UI(Metro UI), Qt, IE, Firefox, Chrome ...
Apache License 2.0
2.5k stars 477 forks source link

将其封装为http服务后调用,无法获取组件信息 #243

Open lxf920125 opened 1 year ago

lxf920125 commented 1 year ago
  1. 基于fastapi封装http服务
  2. 内部调用GetFocusedControl接口,后遍历获取所有element
  3. 打包成exe程序
  4. 将该exe打包为windows service 期望结果:可以通过http接口正常获取页面元素信息 实际结果:1.手动启动exe程序后,可以通过http接口正常获取页面元素信息
  5. 打包为window service后,永远只能获取到Desktop 1信息,获取不到其他相关UI信息
yinkaisheng commented 1 year ago

没用过这种用法,我无法测试。是不是在线程里获取的? 参考demos/uiautomation_in_thread.py

tdRPA commented 1 year ago
  1. 线程问题,come组件不能跨线程使用
  2. 是不是service运行时用户权限问题
landhu commented 4 months ago

@lxf920125 能分享一下你的服务及exe吗?正好也有这样的需求