备忘代码

本文通过一个具体的示例展示了如何使用 Windows API 进行界面元素的查找及操作,包括解密字符串、获取窗口句柄、初始化可访问性工具等步骤。

CString numString;
CString className;
CString accName;
CSRIAccessible accTools;
CString findString;
int nTestId=0;
findString=CEncrypt::DecodeString("Fj5VAAAAEA==");
className=CEncrypt::DecodeString("FAcKCwA6Jx8ICiQHCwAAABA=");
HWND hToolWnd=::FindWindowA(className,NULL);
if (!hToolWnd) goto tab_exit;
className=CEncrypt::DecodeString("Ex0OHiIKBwQPCiQHCwAAABA=");
hToolWnd=::FindWindowExA(hToolWnd,NULL,className,NULL);
if (!hToolWnd) goto tab_exit;
className=CEncrypt::DecodeString("FBYcNw0CFh8AAAAQ");
hToolWnd=::FindWindowExA(hToolWnd,NULL,className,NULL);
if (!hToolWnd) goto tab_exit;
className=CEncrypt::DecodeString("EwAACw4EAToAHRcGGF1bAAAAEA==");
hToolWnd=::FindWindowExA(hToolWnd,NULL,className,NULL);
if (!hToolWnd) goto tab_exit;
if (!accTools.Init(hToolWnd)) goto tab_exit;
accName=accTools.Name(0);
if (accName.IsEmpty()) goto tab_exit;
accTools=accTools.FindChild(accName);
if (!accTools) goto tab_exit;
{
int nChildCount=accTools.GetChildCount();
for (int i=0;i<nChildCount;i++)
{
CString textString=accTools.Name(i);
if (textString.Find(findString)!=0) continue;
int nFindIndex=textString.Find("\r\n");
if (nFindIndex!=-1) textString=textString.Left(nFindIndex);
textString.Replace(findString,"");
textString.Replace(" ","");
numString+=textString;
numString+="\r\n";
}
}
tab_exit:
numString=numString;
return numString;

转载于:https://www.cnblogs.com/SilenceRet/p/6906448.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值