C# Get QQ conversation chat information

Use UIAutomation to obtain QQ conversation chat information

            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");
                }
            }

 I am currently experiencing a problem, incomplete chat information is obtained, and many recent chat information cannot be obtained.

Guess you like

Origin blog.csdn.net/lw112190/article/details/108681898