一个多开例子

 1 Global hwnd//定义全局变量,方便在线程里使用
 2 Hwnd = Plugin.Window.Foreground()
 3 线程id1 = BeginThread(主线程)
 4 Do
 5 按键码 = WaitKey()
 6 If 按键码 = 35 Then //这里是End的按键码
 7 If Plugin.Window.Foreground() = hwnd Then //当前窗口句柄
 8 StopThread 线程id1
 9 EndScript
10 End If
11 End If
12 Loop
13 Sub 主线程//这里主程序,可以把原来的程序直接放在这里
14 do
15 Delay 10000
16 loop
17 End Sub
18 Sub OnScriptExit()
19 返回值 = Lib.窗口.弹出对话框("窗口停止成功!窗口句柄:"&hwnd,1,"",1)
20 End Sub

 

posted @ 2017-10-13 16:00  薇蕨  阅读(144)  评论(0编辑  收藏  举报