pwb2.SendKeys("{Alt n}") doesn't work with ComObject Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
my-lord
Posts: 45
Joined: 01 Apr 2018, 15:12

pwb2.SendKeys("{Alt n}") doesn't work with ComObject

22 Apr 2018, 05:51

Hello guys.I want to send keys to ComObject.I tried following formats :

Code: Select all

pwb2 := (ComObjCreate("InternetExplorer.Application")).Visible:=True
;...
pwb2.SendKeys("{!n}") 
pwb2.SendKeys("{Alt n}") 
pwb2.SendKeys("!n") 
But no one is working.
What is the correct format for sending Alt+N?
Last edited by my-lord on 22 Apr 2018, 07:07, edited 1 time in total.
my-lord
Posts: 45
Joined: 01 Apr 2018, 15:12

Re: pwb2.SendKeys("{Alt n}") doesn't work in ComObject

22 Apr 2018, 07:04

swagfag wrote:https://docs.microsoft.com/en-us/previo ... 3(v=vs.85)

ie com doesnt implement a method called SendKeys()
Thanks.I search https://docs.microsoft.com/en-us/previo ... 3(v=vs.85) and get following result:
Image
But when I click this link, this page return 404 error.Maybe function is deprecated.Is there a way to send keys to the ComObject?
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: pwb2.SendKeys("{Alt n}") doesn't work with ComObject  Topic is solved

22 Apr 2018, 08:09

ok so? SendKeys() is a method implemented by Windows Script Host, not IE

Code: Select all

wsh := ComObjCreate("WScript.Shell")
wsh.SendKeys("some keys{Enter}")
Is there a way to send keys to the ComObject?
idk, probably not, it doesnt appear to be

you can try sending to the IE instance instead
https://autohotkey.com/docs/commands/ControlSend.htm
https://autohotkey.com/docs/commands/PostMessage.htm

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: mikeyww and 279 guests