I got a chrome extension and in the event of a new tab I want to get the window handle in windows if the current window.
On the event I got the tab object and I got chrome's internal window id but this is not the handle in windows.
chrome.tabs.onCreated.addListener(
function (tab)
{
var intMainWindowHwnd = 0; // how to get it? not tab.windowId…
});
Thanks!
Well, if anyone encounter the same problem, i solved it using a NPAPI Plugin in C++ that get access to win32api...
In Invoke method i've checked for my method (GetProcessId) and got the parent process (since the addon is in a different process):
Then i got the main hwnd of this process and return it to my js addon.