2

I am developing a chrome extension which uses chrome's native messaging api to communicate to a host application. The host application is written in C++. Now my host application requires the Window Handle HWND of the chrome tab in which my extension is currently active.

Is there a way to do this? I can't use any of the NPAPI solutions.

I have gone through the documentation of the chrome extensions there doesn't seem to be a way to do this.

I have seen this answer: Get Window Handle of Chrome Tab from Within Extension?

But the above answer doesn't explain things clearly. Is it asking for matching the title of windows by iterating through all the windows? How do I do this? What if multiple tabs have the same title? Can Tab Id or window Id be used in some way?

Community
  • 1
  • 1
tapananand
  • 4,392
  • 2
  • 19
  • 35
  • Well, tabs don't have their own hwnd, only the window has as you can see in `spyxx`. What are you planning to do in your native host app with the hwnd? – wOxxOm Nov 18 '15 at 11:18
  • 1
    @wOxxOm: Spy++ shows different hwnds for different tabs. Keep in mind this question is related to chrome not firefox. – tapananand Nov 18 '15 at 14:48
  • @wOxxOm: I am using the find window option in Spy++ and dragging the finder tool to the different tabs - gives me different handles. – tapananand Nov 18 '15 at 14:51
  • Rendering something in the tab. – tapananand Nov 18 '15 at 14:54
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/95450/discussion-between-woxxom-and-lesnar). – wOxxOm Nov 18 '15 at 14:54
  • https://groups.google.com/a/chromium.org/g/chromium-extensions/c/le_KmOrmDpI – EricLaw Feb 11 '22 at 18:26

0 Answers0