Search code examples
google-chromefirebreathppapi

Can I get chrome's web page's HWND in Windows?


I want to port a web game from firebreath to ppapi, the old implemention is:

  • firebreath plugin pass window's HWND to a other process
  • in the other process,render and update the game

I read some doc of ppapi, it seems that there is no way to get HWND, Can some one give me an idea?


Solution

  • There are a couple of important things to know about this:

    1) PPAPI by itself is only supported for certain built-in plugins, such as flash. You can enable additional ones but only using command-line flages, so it's not viable for any real use.

    2) The one place you can use PPAPI is in a NACL/pNACL plugin, where you generally just talk about using NACL (Native Client) rather than worrying about the name of the API; NACL is designed specifically to not allow you to access system APIs such as the HWND or anything that would use an HWND.

    So the short answer is "no, there is no way to do what you want". The longer answer is that most likely what you want to do will require rewriting as needed to use OpenGL ES w/ NACL. The good news is that this is the same OpenGL that is available on mobile platforms, so with a game you might be able to leverage that.