Page 1 of 1

How to implement clicking URL "my://showAdialog" just showing a dialog without changing the current page content?

Posted: Thu Aug 29, 2024 5:56 pm
by nbuyer
Hi,

I wish to implement clicking a custom URL (e.g. my://showmsg/abc) inside my page to call my Windows App to display a dialog box with "abc" information, and I want the page to remain unchanged after closing the dialog box.

Currently, I'm using js via ExtensionHandler.Execute() to do that, but can ICefResourceHandler be implemented directly to achieve a similar effect? Right now I only know how to use TCustomResourceHandler to return something like a jpg that returns a stream and can't return a “no data” response.


Thanks for your help.

Re: How to implement clicking URL "my://showAdialog" just showing a dialog without changing the current page content?

Posted: Fri Aug 30, 2024 10:46 am
by salvadordf
Hi,

Try using TChromiumCore.OnBeforeBrowse to cancel the navigation with that URL and then send a Windows message to the form to show the dialog asynchronously.

Re: How to implement clicking URL "my://showAdialog" just showing a dialog without changing the current page content?

Posted: Fri Aug 30, 2024 4:28 pm
by nbuyer
That's a good idea, though not very elegant. :-p
I will try. Thanks.