• 新浪微博:
  • 按键公众号 :
按键精灵电脑版
立即下载

软件版本:2014.06
软件大小:22.9M
更新时间:03-18

按键精灵安卓版
立即下载

软件版本:3.5.3
软件大小:46.2M
更新时间:03-02

按键精灵iOS版
立即下载

软件版本:1.7.3
软件大小:29.2M
更新时间:12-06

最新企业版UiBot
立即下载

软件版本:3.3
软件大小:282M
更新时间:08-06

快捷导航

登录 后使用快捷导航
没有帐号? 注册

发新话题 回复该主题

[老狼] [老狼][源码分享]----句柄生成器源码----被迫营业的第二天 [复制链接]

1#
[2020.09.19更新]命令库分享----PC按键----句柄遍历代码生成[第一章●附录]源码分享
***** 该内容需您回复才可浏览 *****
示范:

源码:
  1. DimEnv 子窗口句柄
  2. Declare Function GetParent Lib "user32" Alias "GetParent" (ByVal hwnd As Long) As Long
  3. Public Declare Function SetSystemCursor Lib "user32" Alias "SetSystemCursor" (ByVal hcur As Long, ByVal id As Long) As Long
  4. Public Declare Function LoadCursorFromFile Lib "user32" Alias "LoadCursorFromFileA" (ByVal lpFileName As String) As Long
  5. Public Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, lpvParam As Any, ByVal fuWinIni As Long)
  6. Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
  7. Event Form1.Timer1.Timer
  8. LButton = GetAsyncKeyState(1)
  9. If LButton = 0 Then
  10. hwnd = Plugin.Window.MousePoint()
  11. sRect1 = Plugin.Window.GetClientRect(Hwnd)
  12. xy = Split(sRect1, "|")
  13. GetCursorPos x1, y1
  14. Form1.InputBox3.Text=x1 - xy(0)&","&y1 - xy(1)
  15. Form1.InputBox1.Text = hwnd
  16. Form1.PictureBox1.Picture = "Attachment:\光标2.jpg"
  17. SystemParametersInfo 87, 0, 0, 2
  18. Form1.Timer1.Enabled = False
  19. 子窗口句柄=Hwnd
  20. BeginThread 生成代码
  21. Else
  22. hwnd = Plugin.Window.MousePoint()
  23. Call Plugin.WndEx6.HighlightWindow(hwnd, 4, "0000FF", 200)
  24. End If
  25. End Event
  26. Event Form1.PictureBox1.Click
  27. hCursor = LoadCursorFromFile("c:\变化.cur")
  28. Call SetSystemCursor(hCursor, 32512)
  29. Form1.Timer1.Enabled = True
  30. Form1.PictureBox1.Picture = "Attachment:\光标1.jpg"
  31. Form1.InputBox2.Text = ""
  32. End Event
  33. Event Form1.Load
  34. PutAttachment "c:\","变化.cur"
  35. End Event
  36. Sub 生成代码()
  37. Call Plugin.File.DeleteFile("C:\七罪.txt")
  38. 原始窗口=子窗口句柄
  39. Do
  40. 上一级窗口句柄=GetParent(子窗口句柄)
  41. If 上一级窗口句柄 = 0 Then
  42. 得到顶层窗口句柄 = 子窗口句柄
  43. Exit Do
  44. Else
  45. 结果= 上一级窗口句柄&","&结果
  46. 子窗口句柄=上一级窗口句柄
  47. End If
  48. Loop
  49. Do
  50. If 结果 = "" Then
  51. TracePrint "本句柄为父句柄 or 检查句柄_句柄错误!"
  52. 类名 = Plugin.Window.GetClass(子窗口句柄)
  53. 标题 = Plugin.Window.GetText(子窗口句柄)
  54. Text= "Hwnd = Plugin.Window.Find(" & chr(34) & 类名 & chr(34) & ", " & chr(34) & 标题 & chr(34) & ")"
  55. Call Plugin.Sys.SetCLB(Text)
  56. Form1.InputBox2.Text = Text
  57. Call Plugin.Sys.SetCLB(Text)
  58. TracePrint "写入剪切板完成. ..."&vbcrlf&"作者QQ:1223116618;交流群:891058946"
  59. ExitScript
  60. End If
  61. 分割 = Split(结果, ",")
  62. 类名 = Plugin.Window.GetClass(分割(0))
  63. 标题 = Plugin.Window.GetText(分割(0))
  64. Hwnd = Plugin.Window.Find(类名, 标题)
  65. Call Plugin.File.WriteFileEx("C:\七罪.txt","Hwnd = Plugin.Window.Find("&chr(34) & 类名 &chr(34)& ", " &chr(34) & 标题&chr(34) & ")")
  66. 分割(UBound(分割))=原始窗口
  67. For i = 1 To UBound(分割)
  68. 类名 = Plugin.Window.GetClass(分割(i))
  69. Call Plugin.File.WriteFileEx("C:\七罪.txt", " Hwnd1=0")
  70. Hwnd1 = 0
  71. Do
  72. Hwnd1 = Plugin.Window.FindEx(Hwnd, Hwnd1, 类名, 0)
  73. If Hwnd1 = 0 Then
  74. Exit for
  75. End If
  76. Call Plugin.File.WriteFileEx("C:\七罪.txt","Hwnd1 = Plugin.Window.FindEx(Hwnd, Hwnd1, "&chr(34)&类名&chr(34)&", 0)")
  77. Delay 5
  78. Loop Until Hwnd1 = int(分割(i))
  79. Call Plugin.File.WriteFileEx("C:\七罪.txt","Hwnd = Hwnd1")
  80. Hwnd = Hwnd1
  81. Next
  82. If Hwnd1 / 1 = 原始窗口 / 1 Then
  83. Exit Do
  84. Else
  85. 结果 = mid(结果, instr(结果, ",") + 1, len(结果) - instr(结果, ","))
  86. End If
  87. Loop
  88. Call Plugin.File.WriteFileEx("C:\七罪.txt", "TracePrint Hwnd1")
  89. Call Plugin.File.WriteFileEx("C:\七罪.txt","TracePrint "&chr(34)&"写入剪切板完成. ...作者QQ:1223116618;交流群:677099204"&chr(34))
  90. Text = Replace(Plugin.File.ReadFileEx("C:\七罪.txt"), "|", vbcrlf)
  91. Form1.InputBox2.Text = Text
  92. Call Plugin.Sys.SetCLB(Text)
  93. End Sub
  94. Event Form1.Button1.Click
  95. Call Plugin.Sys.SetCLB( Form1.InputBox3.Text )
  96. End Event
复制代码
源文件:
x.rar (, 下载次数:158)

点评

果壳王子  桌面壁纸才是焦点  发表于 2021/11/16 0:30:44

    已有2评分我要评分查看所有评分

    最后编辑瑞祥幽冥狼 最后编辑于 2022-02-20 22:43:56
    本主题由 超级版主 瑞祥幽冥狼 于 2022/3/26 22:43:11 执行 审核帖子 操作
    收 徒 索 引 ← ← ← ← ← ← ← ← ← ← 点 击

    个 人 Q Q 1 : 1 2 2 3 1 1 6 6 1 8[将满]
    个 人 Q Q 2 : 6 1 7 0 9 5 5 4 3[可加]
    2#

    向大佬学习

    3#

    被迫营业

    4#

    学习学习

    5#

    卧槽牛批

    6#

    高级呀, 太高级了

    7#


    8#

    这个厉害了

    9#

    学习观看

    10#

    vb,直接用?

    11#


    12#

    qqqqqqqqqqqqq

    635787403
    13#

    向大佬学习

    向大佬学习

    14#


    15#

    老师出品 必属精品 学习了

    喜欢学习
    16#

    学习学习

    17#

    这也太牛逼了 这个功能大赞

    18#

    自愿喊666的第二天

    19#

    主动给师傅点赞

    20#

    6666666

    发新话题 回复该主题