[General]
Description=演示例子：多线程测试
BeginHotkey=122
BeginHotkeyMod=0
PauseHotkey=120
PauseHotkeyMod=0
StopHotkey=123
StopHotkeyMod=0
RunOnce=1
EnableWindow=
Enable=0
AutoRun=0
[Repeat]
Type=0
Number=1
[Relative]
SetupOCXFile=
[Comment]
Content=

[Script]
MessageBox "多线程命令还在测试当中，并不稳定，请谨慎使用"
//下面这个例子会打开一个记事本，用2个线程向其中模拟按键
VBSCall RunApp("notepad")
Delay 1000
SetEnv "Key","65"
BeginThread "Thread1"
While 1
    Gosub PressKey
    key=key+1
    If (key>90)
        key=65
    EndIf 
    SetEnv "Key",CStr(key)
EndWhile 
EndScript 
Sub Thread1
    For 10
        Gosub PressKey
    EndFor 
    KeyPress 13,1
    SayString "线程1已经结束"
    KeyPress 13,1
Return 
Sub PressKey
    key=GetEnv("Key")
    KeyPress key,1
    Delay 200
Return 
