当前位置:首页 > 技术心得 > 正文内容

按键精灵 获取控件内容(非窗体标题)

xjtudll10年前 (2017-02-15)技术心得30561

想抓一个软件的 一个类名是Edit的输入框中的内容,句柄已经正确找到了,然后用精灵8自带的 Plugin.Window.GetText(Hwnd) 命令来获取,结果得不到输入框中的控件内容,只得到一个窗口标题 “ 1 ”。 如图示:
clip_image001

想获得这个输入框中的1222 这个值,上述命令,只能获得窗口标题“1”。
clip_image002
这个图是用精易编程助手抓到的。

有什么办法能获取输入框中 1222 这个值?

方法:

利用Win32的SendMessage API来实现

Private Declare Function SendMessage Lib "user32" Alias "SendMessageW" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long

TracePrint getText(69198)

Function GetText(Arg_hwnd)

    Dim S_TextLen

    S_TextLen = SendMessage(Arg_hwnd, &HE, 0, 0)

    S_strText = Space(S_TextLen)

    Call SendMessage(Arg_hwnd, &HD, S_TextLen+1, S_strText)

    GetText = S_strText

End Function

扫描二维码推送至手机访问。

版权声明:本文由鸟的天空发布,如需转载请注明出处。

本文链接:http://xjtudll.cn/Exp/440/

标签: 按键精灵
分享给朋友:

“按键精灵 获取控件内容(非窗体标题)” 的相关文章

金蝶K3单据编码规则扩展方法解密

金蝶K3单据编码规则扩展方法解密

https://baijiahao.baidu.com/s?id=1603718041512798752&wfr=spider&for=pc 在实施客户过程中,客户对单据编码规则提了一些简单的需求: 需求一:内贸订单和外贸订单希望能够通过前缀编码来区分。 需求二:系统订单编码规则为&...

C# 百分号格式化 保持原数不变

C# 百分号格式化 保持原数不变

C# 格式化数字 百分号 需求: 格式化数值为百分比 但是保持输入的数值不变 也就是不要C# 自带的格式化百分数 因为他会自动*100 再加上百分号 解决方案: % 外面套一层 ‘ ’Code var column = this.gridViewItemDet...

Android Studio Warning:Not annotated parameter overrides @NonNull parameter

问题: android studio提示:Not annotated parameter overrides @NonNull parameter 分析: Warning:The @NonNull annotation can be used to indicate that a given par...

群晖Apache 忽略文件名大小写

群晖Apache 忽略文件名大小写

参考资料:https://www.cnblogs.com/shipment/p/14767848.html 1、SSH登录群晖ssh  admin@201.201.201.1682、修改conf文件权限为777sudo chmod 777 /volume1/@appstore/Apache...

Altium原理图update到PCB时某些元件老是自动先删除后添加

Altium原理图update到PCB时某些元件老是自动先删除后添加

现象:从原理图update到PCB时,明明原理图没有变更,但是某些元件老是被自动删除,然后又自动添加进去了,于是PCB里摆好的元件又到了右下角了,导致又要重新摆放元件。 如下图所示,C1~C21先是被remove了,然后又被add了。看起来没什么大碍,但是PCB上之前被摆放好的C1~C21又被自动放...

Android Studio: This version of the rendering library is more recent than your version of Android Studio

Android Studio: This version of the rendering library is more recent than your version of Android Studio

Android Studio预览xml布局时,提示: This version of the rendering library is more recent than your version of Android Studio. Please update Android Studio 如图所示...

评论列表

李
李 IP:
6年前 (2020-12-07)

博主 想咨询你一下关于这个按键精灵获取控件文本的文章,方便加个QQ么254325058

发表评论

访客

◎欢迎参与讨论,请在这里发表您的看法和观点。