Board index » delphi » Communication between applications. Delphi Developer. Communication between applications. 2003-08-02 05:17:36 AM delphi159 What is the best way to pass data and events between different applications? Eg if i press a button in one application, i want a messagebox to popup in the other showing the button caption (a. Walkie-talkie or How to communicate between two Delphi applications Using SendMessage function to communicate between two applications. The FindWindow function retrieves the handle to the top-level window whose class name and window name match the specified strings. As a target window we will use Application's window.
I'm using DCEF3, revision 24038bd3a600, and I should want to communicate between Javascript code in browser and Delphi code of application. I know how it can be accomplished from Delphi code and Javascript, by using framework's method 'ExecuteJavascript', but what about the reverse (from Javascript to Delphi/application code) ?I haven't found such a situation in demos/examples (GUIclient, specifically...).
henry60henry60
2 Answers
There is a guiclient demo if official source code to do this. Look at main.pas file.
The code below is a class extension :
The code below register the extension class :
The code below call your native code from a HTML page :
The code below call your native code from embedded browser :
STB LandSTB Land2,71022 gold badges2525 silver badges3333 bronze badges
A quite easy workaround is to catch the browser's OnJSDialog / OnConsoleMessage event, do an Alert/log in JS when there's something to execute. Tell the delphi part in the alert's message what to do. You need to interpret it as a string (maybe with a scripting library or direct parsing). No direct call of delphi code is possible with it, but I guess it's safer this way anyway.
kgzkgz