3个回答
展开全部
'使用VBS例,下载dynwrap.dll,然后拷贝至c:\windows\system32,运行regsvr32 dynwrap.dll进行注册
Set ws=CreateObject("WSCript.shell")
Set Wrap1 = CreateObject("DynamicWrapper")
Wrap1.Register "USER32.DLL", "FindWindow","I=ss","f=s", "R=l"
Wrap1.Register "USER32.DLL", "SetForegroundWindow", "I=h", "f=s", "R=l"
hWin = Wrap1.FindWindow(vbNullString, CStr("窗口名称"))
if hWin > 0 then
Clipboard = "MsHta vbscript:ClipBoardData.setData(""Text"","""& "您要输入的文本" &""")(Close)"
ws.Run(Clipboard) '复制文本
ws.sendkeys "{tab}" '发送tab键移动焦点
ws.sendkeys "^v" '发送粘贴,确保剪切板有内容
end if
Set ws=CreateObject("WSCript.shell")
Set Wrap1 = CreateObject("DynamicWrapper")
Wrap1.Register "USER32.DLL", "FindWindow","I=ss","f=s", "R=l"
Wrap1.Register "USER32.DLL", "SetForegroundWindow", "I=h", "f=s", "R=l"
hWin = Wrap1.FindWindow(vbNullString, CStr("窗口名称"))
if hWin > 0 then
Clipboard = "MsHta vbscript:ClipBoardData.setData(""Text"","""& "您要输入的文本" &""")(Close)"
ws.Run(Clipboard) '复制文本
ws.sendkeys "{tab}" '发送tab键移动焦点
ws.sendkeys "^v" '发送粘贴,确保剪切板有内容
end if
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询