Flutter Windows Desktop: Integrate with the File Activation API - c++

I am looking for some guidance on implementing the Windows File Activation API with my Flutter App, that is, a user able to open a file associated with my App and have that file path passed to my app instance on startup and during runtime if the user opens a file whilst the app is already started.
I have found the following link from Microsoft that details how to achieve this within a UWP Application. However I have no been able to implement it completely with my limited knowledge of C++.
https://learn.microsoft.com/en-us/windows/uwp/launch-resume/handle-file-activation
It seems that the File Activation API relies on the WinRT API. Is this already bundled with the Flutter runner project or does this need to be imported separately?
To hook into the File Activation API, I need to create a class that is derived from the Application class, Is it possible to achieve this whilst still having a reference to the Platform Channels provided so that the events can be passed into the Dart code?
Is it even a valid approach to use the WinRT API's or is there another API I have missed?

Related

What is the best way to integrate your backend with CEF?

I am currently trying to develop a Windows program using CEF. So I want to integrate the backend in the app and then send the information to the UI via javascript bindings.
I have already integrated my project into CEF as it says in the instructions so like this:
Create a new "myproject" directory in the root cef-project directory (e.g. "/path/to/cef-project/myproject").
Copy the contents of the "third_party/cef/cef_binary_*/tests/cefsimple" directory to "myproject" as a starting point.
Only currently I don't know exactly how to integrate the backend into the code, because it has to run in an external thread, since CEF needs a thread? Or do I see this wrong (I am not yet so familiar with CEF and c++)? Does anyone perhaps have code examples of how to integrate their own c++ code into CEF?

google map api in Windows applications

I was able to call Google Map API in my MFC project for years, but not any more(year 2018). Now my C++ based project shows a script error for Google Map API even after putting in a new API key.
How can I call the Google Map API and use it in Windows Applications based on c++ projects?
There are several ways to do a request to any API using c++, few examples are:
C++ light wrapper
Qt
CPR.
You may also edit your question and add what kind of errors if your problem isn't about deprecation or a specific library that you're using so you can get a fix solution.

How to call UWP API from converted Win32 app. (Desktop App Converter)

I converted Win32 app (C++) to UWP one successfully.
But it can't work read/write file method, so I want to use UWP API from converted app.
Supported UWP APIs for converted desktop apps
I found this sentence "Most UWP APIs work well on converted desktop apps.".
But I can't find the way to call UWP API from converted Win32 app.
How to call UWP API from converted Win32 app ?
Thanks.
How to call UWP API from converted Win32 app ?
Actually, there are some samples in this offcial repository: DesktopBridgeToUWP-Samples
For example, the AppService Bridge Sample includes two projects: BackgroundProcess(Win32 Console application) and UWP(UWP app)
The BackgroundProcess project added reference to System.Runtime.WindowsRuntime and enable UWP AppService implementation, check ThreadProc function
The UWP project will use the new full trust capability to execute this Win32 application to consume the App service. See also Converted desktop app extensions
But it can't work read/write file method
In your scenario, you just need to complete UWP feature(StorageFile class) in the Win32 project and convert to the UWP app.
We have recently published a blog post about calling UWP APIs from Win32 processes. Those APIs generally can be called even without using the Desktop Bridge, but several are only applicable when using the UWP app model which the Desktop Bridge conversion provides:
https://blogs.windows.com/buildingapps/2017/01/25/calling-windows-10-apis-desktop-application
Thanks!

How can I call an UWP API from a C++ desktop application

I would like to access Bluetooth LE devices using the corresponding UWP APIs. However, my application is a "classic" C++ application (3D game) that can't run as a UWP app. Is there a way to do that? Accorind to enter link description here these APIs are published, but I don't know the steps to access them I have only found some posts for Windows 8/8.1 apps that include the Windows.winmd and Platform.winmd metadata files and set the /ZW compilation flag, but this doesn't seem to apply to Windows 10.
You should be able to do this, as the Bluetooth classes (e.g., BluetoothLEAdvertisement) are marked up with DualApiPartitionAttribute (callable from desktop and UWP apps).
Using one of the older Win8.1 desktop samples should give you a good starting point for calling the APIs without requiring /ZW or referencing the winmd files. A good example is the desktop toast API sample.
If you go that route, you can use classic COM to create the UWP/WinRT classes via WRL helpers.
You can use the web that you make a web server and the C++ application use the same server and if UWP send the info to server then it will send the info to C++ application.
To safe,the UWP can't use the desktop app.

Host a c++ desktop application on a webpage

I am having a desktop application which having a UI interface made in Qt linked with a library which is doing all the calculation stuff. Values from UI is taken and pass to the API's in the DLL to get the output which is shown on Screen.
Now i want to do the same thing by transferring my application UI to a web page so that people can access the tool from anywhere without any installation process.
I want to retain my c++ DLL code so i don't have to do a lot of work. I am thinking of just converting this DLL to a C++ server by any communication Process(Sockets). I want to host this application on my company's website. (We have to make the website also so we are open to any set of tools).
I want to know what will be the best set of tools to do this stuff. Also there will be lot of data exchange between the webpage and server so the wholething should be optimized also. I goggled a bit and find stuff like silverlight and ASP.NET, But i am still not very clear which option will be more suitable.
I am a c++ programmer with no web application development experience. I am open to learn any new technology.
Thanks
Why not use Qt on the web directly? There are several projects like this one: http://qtwui.sourceforge.net/
There is a netscape plugin that will host a QT application and an ActiveX control wrapper on the QT website. You could use one of those to wrap your application. Note that this approach would require the user (or their administrator) to download and install the plugin.
An alternative approach might be to run your application through a remote desktop such as XVNC, NX or an RDP based layer. IIRC browser based remote desktop clients are available for most such protocols.
A few options:
pick a messaging/queue implementation (like http://www.zeromq.org/) and provide a service
implement a Windows Web Service if you want to be more enterprise friendly: http://msdn.microsoft.com/en-us/magazine/ee335693.aspx
I would not expose the implementation on the internet. Enough to have a simple buffer overflow and the machine can be taken over quickly. Adding a layer between the app and the web provides an easy way to validate input, access, stats ...
You should be able to use your DLL from an wt or cppcms application. Then you do not have to learn something new and can just use C++.
The way I'm currently doing this is with Boost.Python + django