Page 1 of 1

How to get the pop-up page window handle

Posted: Thu Nov 30, 2017 9:02 am
by blueflagbj
hi,
How to get this pop-up Window handle when opening a new page window

Re: How to get the pop-up page window handle

Posted: Thu Nov 30, 2017 9:44 am
by salvadordf
Try GetActiveWindow, GetForegroundWindow or EnumChildWindows.

Re: How to get the pop-up page window handle

Posted: Fri Dec 01, 2017 1:23 am
by blueflagbj
hi,
I have found a solution like this:
var
NewBrowserHandle:hwnd;

procedure TForm1.chrm1AfterCreated(Sender: TObject; const browser: ICefBrowser);
begin
NewBrowserHandle:=browser.Host.WindowHandle;
PostMessage(Handle, BROWSER_CREATED, 0, 0);
end;

Then receive the message like this:

procedure TForm1.BrowserCreatedMsg(var aMessage : TMessage); message BROWSER_CREATED;
begin
mmo1.lines.add(inttostr(NewBrowserHandle));
end;

Is that okay?Anyway, I got the result.

Re: How to get the pop-up page window handle

Posted: Fri Dec 01, 2017 8:18 am
by salvadordf
Sorry, I misunderstood.

Yes, that's correct.