对VBS代码熟悉的来!帮我注解下.坐等
setWshShell=WScript.CreateObject("WScript.Shell")
Setdm=CreateObject("dm.dmsoft")
WshShell.run("cmd.exe")
Whilehwnd=0
hwnd=dm.FindWindow("","cmd.exe")
wscript.sleep100
Wend
dm_ret=dm.GetWindowRect(hwnd,x1,y1,x2,y2)
msgboxhwnd&vbcrlf&x1&","&y1&","&x2&","&y2,"打开了DOS窗口"
dm.SetWindowTexthwnd,"test"
'hwnd=dm.GetMousePointWindow()
dm_ret=dm.BindWindow(hwnd,"normal","windows","windows",0)
'dm.MoveWindowhwnd,0,0
dm.KeyPress13
dm.sendstringhwnd,"cls&@echooff"
dm.KeyPress13
fori=0to8
str="cls&color"&i&(i+1)
dm.sendstringhwnd,str
dm.KeyPress13
wscript.sleep200
next
dm.sendstringhwnd,"echo3秒倒计时&pause"
dm.KeyPress13
wscript.sleep3000
dm.KeyPress13
dm.KeyPress13
dm.sendstringhwnd,"cls&startnotepad&exit"
dm.KeyPress13
dm_ret=dm.UnBindWindow()
wscript.sleep500
hwnd1=dm.FindWindow("","无标题-记事本")
ifhwnd1>0then
hwnd=dm.FindWindowEx(hwnd1,"Edit","")
dm_ret=dm.BindWindow(hwnd,"normal","windows","windows",0)
msgboxhwnd1&vbcrlf&x1&","&y1&","&x2&","&y2&vbcrlf&"确定后,最小化记事本!","打开了记事本"
dm_ret=dm.SetWindowState(hwnd1,2)
dm.sendstringhwnd,"看到了吧,这个是被最小化过后发送的字符串!"&vbcrlf
wscript.sleep500
dm_ret=dm.SetWindowState(hwnd1,5)
dimarr
str="怎么样,神奇,祝你好运"
arr=split(str,"")
ifhwnd>0then
fori=0toubound(arr)
dm.sendstringhwnd,arr(i)
wscript.sleep200
next
endif
dm_ret=dm.UnBindWindow()
else
msgobx"未能打开记事本,失败!"
endif