当前位置: 首页 > news >正文

C# 获取QQ会话聊天信息

目录

利用UIAutomation获取QQ会话聊天信息

效果 

代码 

目前遇到一个问题

其他解决办法


利用UIAutomation获取QQ会话聊天信息

效果 

代码 

AutomationElement window = AutomationElement.FromHandle(get.WindowHwnd);

AutomationElement QQMsgList = window.FindFirst(TreeScope.Descendants,
    new PropertyCondition(AutomationElement.NameProperty, "消息"));
if (QQMsgList != null)
{
    AutomationElementCollection ALLMsg = QQMsgList.FindAll(TreeScope.Descendants,
        new PropertyCondition(AutomationElement.ControlTypeProperty, ControlType.ListItem));

    foreach (AutomationElement item in ALLMsg)
    {
        rtxtInfo.AppendText(item.Current.Name + "\r\n");
    }
}

AutomationElement window = AutomationElement.FromHandle(get.WindowHwnd);AutomationElement QQMsgList = window.FindFirst(TreeScope.Descendants,new PropertyCondition(AutomationElement.NameProperty, "消息"));
if (QQMsgList != null)
{AutomationElementCollection ALLMsg = QQMsgList.FindAll(TreeScope.Descendants,new PropertyCondition(AutomationElement.ControlTypeProperty, ControlType.ListItem));foreach (AutomationElement item in ALLMsg){rtxtInfo.AppendText(item.Current.Name + "\r\n");}
}

目前遇到一个问题

获取的聊天信息不全,最近的多条聊天信息获取不到。

其他解决办法

1、截图OCR识别

2、不断复制,从剪切板中读取

http://www.lryc.cn/news/285977.html

相关文章:

  • Java中的内存溢出与内存泄漏深度解析
  • 计算机网络安全——密码学入门
  • go语言(八)---- map
  • Flutter:跨平台移动应用开发的未来
  • 二维码地址门牌管理系统:智慧城市新篇章
  • 学习JavaEE的日子 day14 继承,super(),this(),重写
  • 一文梳理Windows自启动位置
  • 【Java 设计模式】行为型之策略模式
  • go实现判断20000数据范围内哪些是素数(只能被1和它本身整除的数),采用多协程和管道实现
  • GPT只是开始,Autonomous Agents即将到来
  • ubuntu source: not found
  • Rancher部署k8s集群测试安装nginx(节点重新初始化方法,亲测)
  • SpringBoot结合thymeleaf的HTML页面不能跳转问题踩坑
  • Apache Zeppelin结合Apache Airflow使用1
  • 分组循环A
  • 《WebKit 技术内幕》学习之九(4): JavaScript引擎
  • [SpringBoot2.6.13]FastJsonHttpMessageConverter不生效
  • (delphi11最新学习资料) Object Pascal 学习笔记---第3章第一节(简单语句与复合语句)
  • Unity - 简单音频
  • SpringCloud中服务间通信(应用间通信)-亲测有效-源码下载-连载2
  • Axios取消请求:AbortController
  • 【江科大】STM32:(超级详细)定时器输出比较
  • Go 复合数据类型
  • Redis(01)——常用指令
  • 基本语法和 package 与 jar
  • 本地读取Excel文件并进行数据压缩传递到服务器
  • 【开源】基于JAVA的停车场收费系统
  • 基于java+Springboot操作系统教学交流平台详细设计实现
  • Nginx 基础使用
  • JavaEE:多线程(2):线程状态,线程安全