按键精灵多线程源码
运行环境:分辨率:1440×900 色深:32位 操作系统:Microsoft Windows XP 按键精灵版本:9.10.10413
@40oak 2012/10/25
Dimenv id1, id2, id3,hd0, hd1, hd2 Dim i, HwndEx,Hwnd,j,a i=0 j = 0 MessageBox "运行3个记事本,依次为线程1,2,3," &vbcrlf &"按下键盘a,b,c,d,e,f,g,h,i" &vbcrlf &"则a,b,c为暂停线程1,2,3,而d,e,f为继续线程,g,h,i为停止线程" RunApp "notepad.exe" RunApp "notepad.exe" RunApp "notepad.exe" Hwnd = Plugin.Window.Search("记事本") MessageBox hwnd HwndEx = Split(Hwnd, "|") Call Plugin.Window.Min(HwndEx(0)) Call Plugin.Window.Min(HwndEx(1)) Call Plugin.Window.Min(HwndEx(2)) MessageBox "最小化" HD0 = Plugin.Window.FindEx(HwndEx(0), 0, "Edit", 0) HD1 = Plugin.Window.FindEx(HwndEx(1), 0, "Edit", 0) HD2 = Plugin.Window.FindEx(HwndEx(2), 0, "Edit", 0) Id1 = BeginThread(多线程1) Delay 150 Id2 = BeginThread(多线程2) Delay 250 Id3 = BeginThread(多线程3) Delay 50 BeginThread 控制监控 Sub 多线程1 For k = 0 To 1000 Call Plugin.Bkgnd.SendString(HD0, k & " ") Delay 30 Next End sub Sub 多线程2 For k = 0 To 1000 Call Plugin.Bkgnd.SendString(HD1, k & " ") Delay 30 Next End Sub Sub 多线程3 For k = 0 To 1000 Call Plugin.Bkgnd.SendString(HD2, k & " ") Delay 30 Next End Sub Sub 控制监控 i=1 While i=1 a=WaitKey Select Case a Case 65 PauseThread Id1 Case 66 PauseThread Id2 Case 67 PauseThread Id3 Case 68 ContinueThread Id1 Case 69 ContinueThread Id2 Case 70 ContinueThread Id3 Case 71 StopThread Id1 Case 72 StopThread Id2 Case 73 StopThread Id3 End Select Wend End Sub
按键精灵安卓版多线程源码
按键精灵运行多线程源码