字典翻译 问答 其它 【对VBS代码熟悉的来!帮我注解下.坐等setWshShell=WScript.CreateObject("WScript.Shell")Setdm=CreateObject("dm.dmsoft")WshShell.run("cmd.exe")Whilehwnd=0hwnd=dm.FindWindow("","cmd.exe")wscript.sleep100Wenddm_ret=dm.GetWindowRect(hw】
问题标题:
【对VBS代码熟悉的来!帮我注解下.坐等setWshShell=WScript.CreateObject("WScript.Shell")Setdm=CreateObject("dm.dmsoft")WshShell.run("cmd.exe")Whilehwnd=0hwnd=dm.FindWindow("","cmd.exe")wscript.sleep100Wenddm_ret=dm.GetWindowRect(hw】
问题描述:

对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

黄昀回答:
  WshShell.run("cmd.exe")//调用命令行程序Whilehwnd=0hwnd=dm.FindWindow("","cmd.exe")//循环直到得到命令行程序的窗口句柄wscript.sleep100Wenddm_ret=dm.GetWindowRect(hwnd,x1,y1,x2,y2)//得到窗口大小位...
孟卓回答:
  这代码能改成后台运行一些游戏吗?
黄昀回答:
  可以,只要你找到那个游戏的后台模式。
点击显示
其它推荐
热门其它推荐
  • 其它