早教吧作业答案频道 -->其他-->
对VBS代码熟悉的来!帮我注解下.坐等setWshShell=WScript.CreateObject("WScript.Shell")Setdm=CreateObject("dm.dmsoft")WshShell.run("cmd.exe")Whilehwnd=0hwnd=dm.FindWindow("","cmd.exe")wscript.sleep100Wenddmret=dm.GetWindowRect(hw
题目详情
对VBS代码熟悉的来!帮我注解下.坐等
set WshShell = WScript.CreateObject("WScript.Shell")
Set dm= CreateObject("dm.dmsoft")
WshShell.run("cmd.exe")
While hwnd=0
hwnd = dm.FindWindow("","cmd.exe")
wscript.sleep 100
Wend
dm_ret=dm.GetWindowRect(hwnd,x1,y1,x2,y2)
msgbox hwnd & vbcrlf & x1 & "," & y1 & "," & x2 & "," & y2,"打开了DOS窗口"
dm.SetWindowText hwnd,"test"
'hwnd = dm.GetMousePointWindow()
dm_ret = dm.BindWindow(hwnd,"normal","windows","windows",0)
'dm.MoveWindow hwnd,0,0
dm.KeyPress 13
dm.sendstring hwnd,"cls&@echo off"
dm.KeyPress 13
for i=0 to 8
str = "cls&color " & i & (i+1)
dm.sendstring hwnd,str
dm.KeyPress 13
wscript.sleep 200
next
dm.sendstring hwnd,"echo 3秒倒计时&pause"
dm.KeyPress 13
wscript.sleep 3000
dm.KeyPress 13
dm.KeyPress 13
dm.sendstring hwnd,"cls&start notepad&exit"
dm.KeyPress 13
dm_ret = dm.UnBindWindow()
wscript.sleep 500
hwnd1 = dm.FindWindow("","无标题 - 记事本")
if hwnd1>0 then
hwnd = dm.FindWindowEx(hwnd1,"Edit","")
dm_ret = dm.BindWindow(hwnd,"normal","windows","windows",0)
msgbox hwnd1 & vbcrlf & x1 & "," & y1 & "," & x2 & "," & y2 & vbcrlf & "确定后,最小化记事本!","打开了记事本"
dm_ret = dm.SetWindowState(hwnd1,2)
dm.sendstring hwnd,"看到了吧,这个是被最小化过后发送的字符串!" & vbcrlf
wscript.sleep 500
dm_ret = dm.SetWindowState(hwnd1,5)
dim arr
str = "怎 么 样 ,神 奇 ,祝 你 好 运 "
arr = split(str," ")
if hwnd>0 then
for i=0 to ubound(arr)
dm.sendstring hwnd,arr(i)
wscript.sleep 200
next
end if
dm_ret = dm.UnBindWindow()
else
msgobx "未能打开记事本,失败!"
end if
set WshShell = WScript.CreateObject("WScript.Shell")
Set dm= CreateObject("dm.dmsoft")
WshShell.run("cmd.exe")
While hwnd=0
hwnd = dm.FindWindow("","cmd.exe")
wscript.sleep 100
Wend
dm_ret=dm.GetWindowRect(hwnd,x1,y1,x2,y2)
msgbox hwnd & vbcrlf & x1 & "," & y1 & "," & x2 & "," & y2,"打开了DOS窗口"
dm.SetWindowText hwnd,"test"
'hwnd = dm.GetMousePointWindow()
dm_ret = dm.BindWindow(hwnd,"normal","windows","windows",0)
'dm.MoveWindow hwnd,0,0
dm.KeyPress 13
dm.sendstring hwnd,"cls&@echo off"
dm.KeyPress 13
for i=0 to 8
str = "cls&color " & i & (i+1)
dm.sendstring hwnd,str
dm.KeyPress 13
wscript.sleep 200
next
dm.sendstring hwnd,"echo 3秒倒计时&pause"
dm.KeyPress 13
wscript.sleep 3000
dm.KeyPress 13
dm.KeyPress 13
dm.sendstring hwnd,"cls&start notepad&exit"
dm.KeyPress 13
dm_ret = dm.UnBindWindow()
wscript.sleep 500
hwnd1 = dm.FindWindow("","无标题 - 记事本")
if hwnd1>0 then
hwnd = dm.FindWindowEx(hwnd1,"Edit","")
dm_ret = dm.BindWindow(hwnd,"normal","windows","windows",0)
msgbox hwnd1 & vbcrlf & x1 & "," & y1 & "," & x2 & "," & y2 & vbcrlf & "确定后,最小化记事本!","打开了记事本"
dm_ret = dm.SetWindowState(hwnd1,2)
dm.sendstring hwnd,"看到了吧,这个是被最小化过后发送的字符串!" & vbcrlf
wscript.sleep 500
dm_ret = dm.SetWindowState(hwnd1,5)
dim arr
str = "怎 么 样 ,神 奇 ,祝 你 好 运 "
arr = split(str," ")
if hwnd>0 then
for i=0 to ubound(arr)
dm.sendstring hwnd,arr(i)
wscript.sleep 200
next
end if
dm_ret = dm.UnBindWindow()
else
msgobx "未能打开记事本,失败!"
end if
▼优质解答
答案和解析
WshShell.run("cmd.exe") //调用命令行程序
While hwnd=0
hwnd = dm.FindWindow("","cmd.exe")// 循环直到得到命令行程序的窗口句柄
wscript.sleep 100
Wend
dm_ret=dm.GetWindowRect(hwnd,x1,y1,x2,y2)//得到窗口大小位置参数
msgbox hwnd & vbcrlf & x1 & "," & y1 & "," & x2 & "," & y2,"打开了DOS窗口"//显示对话框
dm.SetWindowText hwnd,"test"//更改窗口标题
dm.sendstring hwnd,"cls&@echo off" 向窗口发送字符串信息
下面都差不多了,原理一样
While hwnd=0
hwnd = dm.FindWindow("","cmd.exe")// 循环直到得到命令行程序的窗口句柄
wscript.sleep 100
Wend
dm_ret=dm.GetWindowRect(hwnd,x1,y1,x2,y2)//得到窗口大小位置参数
msgbox hwnd & vbcrlf & x1 & "," & y1 & "," & x2 & "," & y2,"打开了DOS窗口"//显示对话框
dm.SetWindowText hwnd,"test"//更改窗口标题
dm.sendstring hwnd,"cls&@echo off" 向窗口发送字符串信息
下面都差不多了,原理一样
看了 对VBS代码熟悉的来!帮我注...的网友还看了以下:
关于微分方程的解写成e^x的形式如题题目是y`=2xy求通解我解到lnlyl=x^2+c1可是最后 2020-06-03 …
刘老师,您好.我想请您帮我看看这道题是出自哪里?还有它应该怎么解?规定E={a1,a2,a3,a4 2020-06-11 …
如图,AB∥DE,试问∠B、∠E、∠BCE有什么关系.解:∠B+∠E=∠BCE过点C作CF∥AB, 2020-06-12 …
f(x)=e^x+∫tf(t)dt-x∫f(t)dt解f'(x)=e^x+xf(x)-∫f(t)d 2020-07-31 …
急y=1/12e^(5x)是非齐次方程y''-3y'+2y=e^(5x)的解及y1=e^x,y2= 2020-07-31 …
若:y'''+8y=0的特征方程为:λ^3+8=(λ+2)(λ^2-2λ+4)=0有根:λ1=-2, 2020-10-31 …
1、已知e^5-3x=e^2(y+2),ln(4x-y)=4ln2,求x,y的值.2、解方程4x^3 2020-11-01 …
能把这题做出来的,化学就学到一定境界了!X,Y是周期表中相邻两种元素,X单质与CaCO3反应生成B和 2020-11-14 …
已知电源电压为E,内阻为y,输出功率与负载电阻R的导数关系式P'(R)=[E∧2*R/(R+r)∧2 2020-12-18 …
用英文回信:根据e-mail的内容回一封信、与他交流看法、并帮他排忧解难!急e-mail的内容如下: 2020-12-28 …