返回列表 发帖

[转贴] VBS脚本SendKeys与16进制的结合使用(打开IE、播放器,静音等)

Dim WshShell
Set WshShell = CreateObject("Wscript.Shell")
'下面的每一行都是一个不错的命令,请说出运行下列每个语句的效果。不要一次运行全部,逐个看效果。
'打开IE
'WshShell.SendKeys Chr(&H88AC)
'系统静音
'WshShell.SendKeys Chr(&H88AD)
'WshShell.SendKeys Chr(&H88AE)
'WshShell.SendKeys Chr(&H88AF)
'WshShell.SendKeys Chr(&H88B4)
'WshShell.SendKeys Chr(&H88B5)
'WshShell.SendKeys Chr(&H88B6)
'WshShell.SendKeys Chr(&H88B7)COPY
结合使用打开IE,输入www.bathome.net 回车
Dim WshShell
Set WshShell = CreateObject("Wscript.Shell")
WshShell.SendKeys Chr(&H88AC)
Wscript.Sleep 2000
WshShell.SendKeys "www.bathome.net"
WshShell.SendKeys "{enter}"COPY
让系统静音的代码,将下面的代码保存为1.vbs,双击运行即可。
Dim WshShell
Set WshShell = CreateObject("Wscript.Shell")
WshShell.SendKeys Chr(&H88AD)COPY
剩下的自己研究吧,研究出来的朋友可以留言补充。
一般来说SendKeys并不可靠,因为窗口焦点经常难以预料和控制。AppActivate方法有时会导致窗口闪烁,然后无法再激活,且对未知窗口标题的程序更是没有办法。

太神奇了...贪心一点...请问这些值是怎么得到的...

TOP

太神奇了...贪心一点...请问这些值是怎么得到的...
daols 发表于 2012-2-3 06:51

http://www.cn-dos.net/forum/viewthread.php?tid=40374

第20楼

TOP

为什么要反复转载呢?还不注明出处。。本论坛都有好几个转载了。
再说这与16进制毫无关系,哗众取宠。原理cn-dos那个帖子解释得很清楚了。

TOP

为什么要反复转载呢?还不注明出处。。本论坛都有好几个转载了。
再说这与16进制毫无关系,哗众取宠。原理 ...
powerbat 发表于 2012-2-3 14:29


他发的帖子从来都不注明出处。

TOP

返回列表