c - 如何使用纯 C 检索自动化元素的控件类型
问题描述
Objective:通过纯 C 从 Uiautomation 元素中获取控件类型名称作为字符串(即 Button、Checkbox、Menu、MenuItem 等)
到目前为止,我有以下代码:
#define COBJMACROS
#include "UiAutomationClient.h"
#include "UiAutomationCore.h"
POINT pt;
IUIAutomation *pAutomation = NULL;
IUIAutomationElement *element = NULL;
CONTROLTYPEID element_type;
GetCursorPos(&pt);
hr = IUIAutomation_ElementFromPoint(pAutomation, pt, &element);
if(SUCCEEDED(hr) && element != NULL){
hr = IUIAutomationElement_get_CurrentControlType(element,&element_type);
if(SUCCEEDED(hr)){
????
}
}
据我了解 get_CurrentControlType 我得到了控件类型的 ID,但我对该控件类型的名称感兴趣。有没有人知道该怎么做?提前谢谢
解决方案
推荐阅读
- python-3.x - 尝试/除了损坏的网址
- html - 在多个堆叠上下文及其子元素之间设置堆叠顺序
- latex - 如何使用 scalerel 调整表情符号图像的大小
- c# - 使 PHP md5 哈希匹配 C# 哈希
- android - Android Jetpack:使用 LiveData 和 ViewModels 执行生命周期感知的周期性周期性任务
- excel - 检查用户输入是否已经存在于第 1 行的填充单元格中
- sql - 从 SQL 中的多个表中获取匹配值
- android - 模块 AppRegistry 不是注册的可调用模块(调用 runApplication) - 用于 Jitsi-meet
- dart - Flutter 新手开发者关于“等待”的问题
- html - 如何在 css/scss 中从孩子定位父母的兄弟姐妹?