On Fri, Jul 17, 2009 at 12:06 PM, Daniel Wagner-Hall <dawag...@gmail.com>wrote:

>
> I can happily get the plugin's window handle using standard NPAPI
> calls, I'm trying to get the window handle of arbitrary tabs (and
> indeed frames) which my extension has loaded
>
> Specifically, I am opening pages, at the moment using window.open in
> the background page (though this may change to something slightly more
> clean, I haven't really considered what/how yet), and manipulating
> them with Javascript (e.g. grabbing their title).  I can interact with
> them through Javascript from the background page, but would like to be
> able to generate native OS events to the window handle of the
> windows/tabs which I open...
>
> From my experimenting with Spy++ and the results of NPAPI SetWindow
> calls, the HWND returned for the plugin has no parent which can be
> conveniently used, though there may be some clever scheme used which
> I'm just not seeing by not knowing how things really work.


This wouldn't be robust, as Chrome has switched the window hierarchy in the
past and it might occur again in the future (even to the extreme of that
plugin window not having a parent).

What you probably want to do is call NPN_GetValue on NPNVnetscapeWindow to
get the HWND of the page where the calling plugin is hosted.  To get the
HWND of other windows that you open, you can embed a plugin instance in
them, and script them using JS which ends up calling into binary code, which
then calls NPN_GetValue.


>
> >
>

--~--~---------~--~----~------------~-------~--~----~
Chromium Developers mailing list: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
    http://groups.google.com/group/chromium-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to