Programmatically terminate CEF based application

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.

Programmatically terminate CEF based application

Postby tashimaya » Fri Nov 21, 2014 5:41 am

I'm using a custom URL scheme as described here: http://msdn.microsoft.com/en-us/library/aa767914(v=vs.85).aspx

Code: Select all
HKEY_CLASSES_ROOT
      (Default) = "URL:MyApp Protocol"
      URL Protocol = ""
      DefaultIcon
         (Default) = "myapp.exe,1"
      shell
         open
            command
               (Default) = "C:\Program Files\MyApp\myapp.exe" -url "%1"


I have a web page with links:

Code: Select all
<a href="myapp://bbc.co.uk">myapp://bbc.co.uk</a> // 1
<a href="myapp://close">myapp://close</a> // 2


When I click on 1, command line argument -url "bbc.co.uk" is passed to my CEF based application, the application starts up and loads the page fine.

What I would like to achieve is to close the application cleanly when I click on 2.

How can I programmatically terminate a CEF based application cleanly?
tashimaya
Techie
 
Posts: 36
Joined: Fri Oct 10, 2014 7:18 am

Re: Programmatically terminate CEF based application

Postby magreenblatt » Fri Nov 21, 2014 10:01 am

That depends on the application and OS. If using a windowed browser you probably want to close the top-level window (post WM_CLOSE message on Windows).
magreenblatt
Site Admin
 
Posts: 12408
Joined: Fri May 29, 2009 6:57 pm


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 59 guests