本帖最后由 n15976906190 于 2015-1-17 14:05 编辑 注:论坛翻了下,找到2个本类型帖子,但均存在过于繁琐、测试异常、过慢等问题,所以就写了一个- 您所在的用户组无法下载或查看附件
- 您所在的用户组无法下载或查看附件
根据大小获取句柄 "TXGuiFoundation",907,524
Sub 根据大小获取句柄(类名, 宽, 高)
set dm = createobject("dm.dmsoft")
hwnds = dm.EnumWindow(0, "", 类名, 2 + 8 + 16)'如果遍历不到,就改成2
Var1 = Split(hwnds, ",")
For i = 0 To UBound(Var1)
sRect = Plugin.Window.GetClientRect(Var1(i))
MyArray = Split(sRect, "|")
L = Clng(MyArray(0)): T = Clng(MyArray(1))
W = Clng(MyArray(2)): H = Clng(MyArray(3))
If W = 宽 and H = 高 Then '存在一定问题 理解后修改
TracePrint Var1(i)
End If
Next
End Sub
Hwnd = Plugin.Window.MousePoint()
根据大小获取句柄 "Button"
Sub 根据大小获取句柄(类名)
set dm = createobject("dm.dmsoft")
hwnds = dm.EnumWindow(Hwnd, "", 类名, 2 + 8 + 16)'如果遍历不到,就改成2
Var1 = Split(hwnds, ",")
For i = 0 To UBound(Var1)
TracePrint Var1(i)
Next
End Sub