早教吧作业答案频道 -->其他-->
对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代码熟悉的来!帮我注...的网友还看了以下:
x属于R,函数y=sin^2x-2tsinx+2t有最小值k(t).求k(t)解析式x属于R,函数 2020-05-16 …
h=1/2*g*t^2,tan角a=h/v*t消去t,解得v*tan角a=根号下g*h/2 2020-06-05 …
请教加速度v^2-u^2=2as是怎么推导出来的?如果可以请顺便用v-t解释一下,目前还是高一,理 2020-06-12 …
令lnx=t解得:x=e的t次方(中间的步骤)? 2020-06-17 …
瞬时增长速率积分N0代表初始种数,N代表经时间t后的种数求增长速率RR=(lnN-lnN0)/t. 2020-07-02 …
lthenktherebemorebuildingsintwoyears.A:don't;will 2020-07-17 …
已知:dx(t)/dt=y(t)x(t),初始条件为x(0)=0,y(t)不恒等于0.x(t)必定 2020-07-23 …
伽利略在研究自由落体运动时,主要遇到了两个问题:①无精确的计时仪器;②无测量瞬时速度的工具,关于伽 2020-07-29 …
词目:东飘西徒拼音:dōngpiāoxītú解释:徒:迁徒.到处漂泊,迁徒不词目:东飘西徒拼音:dō 2020-11-23 …
高中函数已知f(x)=2^(x+1)是定义在R上的函数1.若f(x)可以表示为一个偶函数g(x)和奇 2020-12-22 …