On Fri, Jul 17, 2009 at 7:06 PM, Daniel Wagner-Hall<[email protected]> wrote:
> 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.

As I was trying to describe earlier, it's not so much the parent as it
is the great-grandparent.
If you are willing to write something fragile I think that's your best bet.

One trick that might help is that we set a window title
(::SetWindowText()) on the window containing the "page", while all of
the windows in between don't have one.  Here's an xwininfo -tree
snippet on Linux with one plugin:

xwininfo: Window id: 0x300001e
"file:///work/chrome/src/webkit/data/test_shell/plugins/embed4.htm -
Chromium"

  Root window id: 0x13b (the root window) (has no name)
  Parent window id: 0x147981d (has no name)
     8 children:
     0x3000044 (has no name): ()  617x519+0+93  +515+384
        4 children:
        0x3000398 (has no name): ()  296x21+0+667  +515+1051
           1 child:
           0x3000399 (has no name): ()  294x19+1+1  +516+1052
        0x3000176 "test_shell home": ()  617x518+0+1  +515+385
           1 child:
           0x30004c9 (has no name): ()  300x300+8+71  +523+456
              1 child:
              0x3400003 "chrome": ("chrome" "Chrome")  300x300+0+0  +523+456
                 2 children:
                 0x340001e (has no name): ()  300x300+0+0  +523+456
                 0x3400004 (has no name): ()  1x1+-1+-1  +522+455

0x30004c9 is the window that was passed to NPAPI's SetWindow, and
0x3000176 (which has the page title "test_shell home") is the one that
contains "the page".

But the general answer to your question remains: no, there's no
non-fragile way of doing this.

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

Reply via email to