various way in which window application can send data to web application using cef - chromium-embedded

How to send context data from wPF application to the WebApplication using CEF? Currently I am sending the data by using the functionality of CEF i.e. by executing Javascript on the brower, serching the control and then binding the value, is there any other way of doing the same?

Related

Limitations of using WebBrowser control to create WPF apps [duplicate]

I've recently stumbled across WebBrowser WPF control. I am interested if there are any limitations when building user interfaces with HTML+CSS+JS and embedding them in WebBrowser.
So far I've successfully
intercepted HTML click events and handled them in C# using
[ComVisible(true)] class attribute
called JS script from C# using InvokeScript method.
InvokeScript also supports sending objects to the HTML/JS via parameters which faciliates two way communication.
Is there any reason for not using using WebBrowser to create simple apps? I am intersted in parts that absolutely need to be handled with some WPF code and cannot be bridged using WebBrowser.

WinForms WebBrowser control's JavaScript execution context

I am using the WinForms WebBrowser control in my C# application and I can interact with the JS code on the web page by setting a COM class in the ObjectForScripting property of the control.
Is it possible to get the JavaScriptContext object from the web browser control that I can use with the ChakraCore API?
No sir, ChakraCore is part of the Microsoft Edge JavaScript engine. It is literally a separate engine. The web browser control uses IE's engine. Although admittedly it doesn't help that the dev team at MS called The MS Edge Engine Chakra when they were calling the engine from IE 9 forward as Chakra also.
Anyway if you want to use/embed the ChakraCore engine from C# they did create a getting started page. I will link it here.
The API for the winforms Webbrowser control Engine is here. The is a wrapper around the COM API. If you need to get to the COM api to do advanced things, you will need MSHTML, which you add as a COM reference to Microsoft Html Object library. The reference for MSHTML is here.

Is it possible to open a web page from a Cortana background app?

Cortana background apps provide deep linking capabilities, which allow the developer to link to a specific page within her app. I'm wondering if it's possible to open a different application instead, for example a web browser.
My current work-around is to deep-link into my app, and then call Windows.System.Launcher.launchUriAsync as soon as my app is launched. However, this means that the app opens along of the web browser. I would like it to not open at all! Is that possible?
From the MSDN page for LaunchUriAsync:
Unless you are calling this API from a Classic Windows application, this API must be called from within an ASTA thread (also known as a UI thread).
Unfortunately, Cortana's background task is not a UI thread. You're running as a background task, and communicating to Cortana's UI via a set of APIs provided for that purpose, which are limited by design.
Anything you try to do that requires you to be in the UI thread is going to fail for the same reason. You could try hosting the web control in your app however to remove the chain-launched browser from the equation.

can we inject flex/air based component in winform application?

I am starting to write a flex based data visualization application. I would like to consider the possibility of injecting this as a component in an existing MDI winforms application.
Is there a way to server this integration by deploying my flex app as a AIR based application and somehow integrate it in a MDI winform application as a child window ?
I highly doubt this is possible but would like to know if someone made an attempt to do this sort of integration successfully.
If you can integrate a IE instance in WinForm then you should be able to run the flex from there.
Communication could then be established between winform and flex via ExternalInterface in Flex (which talks to javascript in the IE instance).

Recording Screen Interactions using UI Automation for Silverlight controls

I am trying to use UI Automation to record screen interactions in my Silverlight app. I have the Automation Peers for my control setup but am not able to figure out how to track these controls.
For my WPF app I would get hold of AutomationElement.RootElement and then navigate down to my App and setup Automation event Handlers on the controls I am interested in.
How would I do the same for Silverlight app? I want the screen recorder to start automatically whenever my app runs. The screen recorder has to sit within my App. But the System.Windows.Automation silverlight namespace doesn't have a AutomationElement class. So how would I do this in Silverlight?
Thanks
Shivaprasad
As you observed, the AutomationElement class doesn't exist in Silverlight: the UIAutomation API is available only in the full .Net framework. Silverlight is only supported as an UI Automation provider - that is, Silverlight applications can be controlled by UI Automation, but they are not able to control other applications.
For this reason, I don't think you're going to be able to create your screen recorder within the Silverlight application - unless you are prepared to resort to some nasty hacks.
Such hacks might include:
Using Silverlight COM Automation to call the new UIAutomation COM API. Users would be required to have the COM API installed on their machines in addition to Silverlight.
Create a "server" application in .Net that you can run on the target machine that does the actual UIAutomation work, then communicate with this from your Silverlight application using WCF.

Resources