当前位置 :
【对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】
3人问答
问题描述:

对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)//得到窗口大小位...
孟卓回答:
  这代码能改成后台运行一些游戏吗?
黄昀回答:
  可以,只要你找到那个游戏的后台模式。
最新更新
PC端 | 移动端 | mip端
字典翻译(zidianfy.com)汇总了汉语字典,新华字典,成语字典,组词,词语,在线查字典,中文字典,英汉字典,在线字典,康熙字典等等,是学生查询学习资料的好帮手,是老师教学的好助手。
声明:本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
电话:  邮箱:
Copyright©2009-2021 字典翻译 zidianfy.com 版权所有 闽ICP备2022014709号-7
lyric 頭條新聞