AsyncPP identification question

  • Thread starter Thread starter mrbog
  • Start date Start date
M

mrbog

Hello, I wrote an Asynchronous Pluggable Protocol namespace handler.
When my Start() method gets called, I would like to know which browser
window is calling it. So, I want to be able to get the
InternetExplorer object of the browser window that called it. Is that
passed in anywhere or can I make a call to get it somehow?

thank you
 
mrbog said:
Hello, I wrote an Asynchronous Pluggable Protocol namespace handler.
When my Start() method gets called, I would like to know which browser
window is calling it. So, I want to be able to get the
InternetExplorer object of the browser window that called it. Is that
passed in anywhere or can I make a call to get it somehow?

As far as I know, there's no way. Besides, an APP is not necessarily
created on behalf of a browser - any application using URL monikers
ultimately uses an APP. It can be, say, a Flash ActiveX control hosted
on a page and loading a movie file.

What are you really trying to do?
--
With best wishes,
Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken
 
mrbog said:
I am able to do both of theses things seperately- The asyncpp works
fine, and I can sink events on running internet explorer instances.
The only problem is, I have no way of telling which running Internet
Explorer window is the one the user just entered the url into. The
dom tree won't have been built yet so I can't check document.href or
something like that. So right now I just sink events on all open
internet explorer windows, but obviously that's a bit of overkill- I
only want the relevant one.

You may try going by thread ID. Internet Explorer creates a new thread
for each top-level browser window, even if they are in the same process.
IInternetProtocol::Start will be called on this thread, and can notify
main application. The application will then enumerate IE instances, call
IWebBrowser2::get_HWND on each, then use GetWindowThreadProcessId to
determine if this is the right thread and the right IE instance.
--
With best wishes,
Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken
 
Back
Top