问题描述
目标:通过简单的C从Uiautomation元素获取控件类型名称作为字符串(即按钮,复选框,菜单,菜单项等)
#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,但是我对该控件类型的名称感兴趣。有人知道该怎么做吗?提前Tks
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)