au3脚本才能在指定窗口发送模拟键
If (@OSTYPE <> 'WIN32_NT') Then
MsgBox(0, '系统环境错误', '本程序只适用于 Windows NT/2000/XP/2003 系统!')
Exit
EndIf
If WinExists("永恒之塔") Then
SendKeepActive ("永恒之塔")
Send("!D")
EndIf
上面代码另存为.au3再用Aut2Exe转换为.exe
Dim objws
Do
Set objws=WScript.CreateObject("wscript.shell")
objws.AppActivate "窗口标题"
WScript.Sleep 100
objws.SendKeys "d"
loop
'这样试试行不行