中国开发网: 论坛: 程序员情感CBD: 贴子 831778
pigprince: 我觉得是可以的,
下面这个程序是python操作shell来sendkey的例子,具体的你再查一下MSDN,2003肯定是可以的


import win32api
import win32com.client

shell = win32com.client.Dispatch("WScript.Shell")
shell.Run("notepad")
win32api.Sleep(100)
shell.AppActivate("notpad")
#win32api.Sleep(100)
shell.SendKeys("1{+}")
#win32api.Sleep(500)
shell.SendKeys("2")
#win32api.Sleep(500)
shell.SendKeys("~") # ~ is the same as {ENTER}
#win32api.Sleep(500)
shell.SendKeys("*3")
#win32api.Sleep(500)
shell.SendKeys("~")
#win32api.Sleep(2500)
shell.SendKeys("^ ")
win32api.Sleep(500)
shell.SendKeys("a")
shell.SendKeys(" ")
shell.SendKeys("s")
shell.SendKeys("b")
shell.SendKeys("2")
shell.SendKeys(" ")
欢迎访问新版:我读书我存在

www.freecoder.org/~phil

我爱大锁头啊!我爱大锁头!!!!

相关信息:


欢迎光临本社区,您还没有登录,不能发贴子。请在 这里登录