马上加入TC
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
namespace mthreader
int thre_hand
bool isstop
function int thre_moth()
//while(true)
//help.messagebox("this is a threader!!")
//help.sleep(1000)
//endwhile
string ret=system.enum("Notepad",1)//类名枚举
string[] str_hand=string[1]
bool isok=str.split(ret,"|",str_hand)
int c1,i=0
array.size(str_hand,c1)
while(i<c1)
mthreader.send_window(str_hand)
i=i+1
endwhile
return 0
endfunction
function int send_window(string str_han2)//向窗口发送信息
string ret=system.enum("str_han2",3)//父窗口枚举子窗口
string[] str_hand=string[1]
bool isok=str.split(ret,"|",str_hand)
int c1,i=0,hander
array.size(str_hand,c1)
while(i<c1)
if(window.getwindowtype(convert.strtoint(str_hand,0))=="Edit")
hander=convert.strtoint(str_hand)
break
endif
i=i+1
endwhile
window.postkeypress(hander,13)
window.sendstring(hander,"hello Tc!!"+convert.inttostr(hander))
window.postkeypress(hander,13)
return 0
endfunction
function bool start_click()
thre_hand=thread.beginthread("mthreader.thre_moth","")
return true
endfunction
function bool exit_click()
help.exit()
return true
endfunction
function bool stop_wheth_click()
if(!isstop)
thread.suspendthread(thre_hand)
isstop=true
else
thread.resumethread(thre_hand)
isstop=false
endif
return true
endfunction
function bool closser_click()
thread.closethread(thre_hand)
return true
endfunction
endnamespace
|