On Tue, 6 Jul 2021 23:28:29 -0400, Mayayana wrote:
>
> I've never noticed that object before, but I do find I can
> mount it in an HTA with the following:
>
> <OBJECT ID="WB" CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"
> width=600 height=400> </object>
>
> I can then navigate to a local HTML file via script. I don't know
> if that's of any value to you. It would, at least presumably be in
> the same process.
>
> Or is it the same process? I don't know. Spy++ shows it with
> an Internet Explorer_Server and a second one under that. But
> a WB generally does its own thing. I'm not sure it's ever in-process.
It's in the same process, yes. WebBrowser is an embedded IE. It doesn't
require external process to actually host IE. The embedded IE is actually
hosted in the process which creates the ActiveX control. It may create
additional (hidden) windows, but it won't create new process - at least for
hosting IE.
However, the script I wrote is for console use, so it needs to be run from
WSH. If combined with HTA, it would be the same case as IE remoting if the
WSH script encounters an unexpected error and abruptly terminates - where
it'll make the HTA process an orphan.
But I just realize that I could use `PutProperty()` & `GetProperty()` to
mark the remote IE instance, so that it can be identified as "an IE instance
created by this script" and be reused or closed.