Strange window stub appears after closing the CEF window

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Strange window stub appears after closing the CEF window

Postby KnIfER » Wed Oct 07, 2020 7:05 am

How to close the browser window? cefbrowser->CloseBrowser() will close the Main Application window, but I am using cefbrowser as a widget.

I tryied:

ShowWindow(hBrowser, SW_HIDE);
ShowWindow(GetParent(hBrowser), SW_HIDE);
CloseWindow(hBrowser);
DestroyWindow(hBrowser);


and:


((client::ClientHandler*)(*pBrowser)->GetHost()->GetClient().get())->DoClose(*pBrowser);

but the browser window is not closed completely. see the image attachment.
Attachments
image.png
image.png (193.15 KiB) Viewed 1669 times
KnIfER
Newbie
 
Posts: 7
Joined: Sun Jul 15, 2018 5:33 am

Re: Strange window stub appears after closing the CEF window

Postby KnIfER » Wed Oct 07, 2020 11:56 am

extern "C" __declspec(dllexport) void bwDestroyWebview(CefRefPtr<CefBrowser>* pBrowser)
{
if (!CefCurrentlyOn(TID_UI)) {
CefPostTask(TID_UI, base::Bind(bwDestroyWebview, pBrowser));
return;
}
if(pBrowser)
{
((client::ClientHandler*)(*pBrowser)->GetHost()->GetClient().get())->DoClose(*pBrowser);
DestroyWindow((*pBrowser)->GetHost()->GetWindowHandle());
(*pBrowser)->Release();
}
}



done.
KnIfER
Newbie
 
Posts: 7
Joined: Sun Jul 15, 2018 5:33 am


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 103 guests