Re: Can I call a Javascript function using a BHO



I've used the execscript a long time ago.

Snippet from
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1378883&SiteID=1

CComPtr<IDispatch> spDisp;
spDoc->get_Script( &spDisp );
CComQIPtr<IHTMLWindow2> spWin = spDisp;
VARIANT pvarRet;
HRESULT tt =
spWin->execScript(_bstr_t("alert(1)"),_bstr_t("JavaScript"),&pvarRet);

Substitute your own method name.

- conan

"Angus" <nospam@xxxxxxxxx> wrote in message
news:uNc5SiVZHHA.2432@xxxxxxxxxxxxxxxxxxxxxxx
Hello

I am writing a BHO to automate some web processes. I want to call a
javascript function. Reason is the web page I want to open is not
viewable
on the web page I am automating. There is no link to it.

If I click on the links that are on the page you see this sort of thing:

javascript:OpenWindow("servername","Form_to_Open",2,1);

Can I call this javascript function using the browser object model? If so
how? Any direction would be much appreciated.

If I substitute the above javascript for:

javascript:OpenWindow("servername","Another_Form_to_Open",2,1);

Then should that work too?

Angus




.



Relevant Pages

  • Can I call a Javascript function using a BHO
    ... I am writing a BHO to automate some web processes. ... Reason is the web page I want to open is not viewable ... Can I call this javascript function using the browser object model? ...
    (microsoft.public.inetsdk.programming.webbrowser_ctl)
  • Can I call a Javascript function using a BHO
    ... I am writing a BHO to automate some web processes. ... Reason is the web page I want to open is not viewable ... Can I call this javascript function using the browser object model? ...
    (microsoft.public.vc.atl)