hi,
How to get this pop-up Window handle when opening a new page window
Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.
How to get the pop-up page window handle
- salvadordf
- Posts: 4620
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: How to get the pop-up page window handle
Try GetActiveWindow, GetForegroundWindow or EnumChildWindows.
-
- Posts: 8
- Joined: Mon Jul 10, 2017 8:08 am
Re: How to get the pop-up page window handle
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.
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.
- salvadordf
- Posts: 4620
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: How to get the pop-up page window handle
Sorry, I misunderstood.
Yes, that's correct.
Yes, that's correct.