Page 1 of 1

SendKeys command in WebBrowser object

PostPosted: Mon Aug 17, 2015 7:39 pm
by fkapnist
In my Neobook application I have an object called WebBrowser1. I want to run a SendKeys command only in WebBrowser1.
If for example I use SendKeys "" "{Down}" any other program window that is on top or active will also respond according to the SendKeys command (which I don't want to do). If I use SendKeys "AppID" "{Down}" my Neobook application steps through its own pages (which I don't want it to do). How can I run a SendKeys command only in WebBrowser1 ?


:?:

.

Re: SendKeys command in WebBrowser object

PostPosted: Mon Aug 17, 2015 10:57 pm
by Tony Kroos
You will need a custom plugin designed to send key messages to a given window handle.
But, since it's a WebBrowser... do you really need sendkeys? It looks like a silly workaround to me, BrowserExecScript is all you need to deal with browser.

Re: SendKeys command in WebBrowser object

PostPosted: Tue Aug 18, 2015 2:34 am
by fkapnist
Tony Kroos wrote:You will need a custom plugin designed to send key messages to a given window handle.
But, since it's a WebBrowser... do you really need sendkeys? It looks like a silly workaround to me, BrowserExecScript is all you need to deal with browser.


Thanks Tony !

This works quite well and does not affect other windows:

SetVar "[status]" "Scrolling Down"
SetVar "[loop]" "1"
While "[loop]" "=" "1"
Delay "1000"
BrowserExecScript "WebBrowser1" "window.scrollBy(0, 100);" "JScript"
EndWhile



:)