分享

按键精灵-多线程多开例子

 小K记 2020-10-03
注册大漠的例子参考以前的文章,有代码。

Global Hwnd

Call 注册大漠()//自己需要注册

HwndEx = Plugin.Window.Search("【你的游戏顶层句柄名称】")

//你的游戏顶层句柄名称

MyArray = split(Hwndex, "|")

If UBound(myarray) >= 0 Then 

    For i = 0 To UBound(myarray) - 1

        hwnd = clng(myarray(i))

        //下面这句

        TracePrint "目标句柄为:" & hwnd

        xID = BeginThread(主线)

        yID = BeginThread (子线)

        Delay 500

    Next

End If

Sub 主线()

    HD = hwnd

    Set dm = createobject("dm.dmsoft")

    dm_ret = dm.setpath("C:\test_game\")

    For 5

        //绑定

        dm_ret = dm.bindwindow(HD, "图色绑定模式", "鼠标绑定模式", "键盘绑定模式", 0)

        If dm_ret = 1 Then 

            TracePrint "绑定成功"

            Exit For

        Else 

            TracePrint "绑定失败"

        End If

        Delay 400

    Next

    Do

        Call 你想做的事情()

    Loop

End Sub

Sub 子线()

    HD = hwnd

    Set dm = createobject("dm.dmsoft")

    dm_ret = dm.setpath("C:\test_game\")

    For 5

        //绑定

        dm_ret = dm.bindwindow(HD, "图色绑定模式", "鼠标绑定模式", "键盘绑定模式", 0)

        If dm_ret = 1 Then 

            TracePrint "绑定成功"

            Exit For

        Else 

            TracePrint "绑定失败"

        End If

        Delay 400

    Next

    Do

        Call 你想做的事情()

    Loop

End Sub

    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多