windows service to Desktop Application communication - c++

I'm new to programming. There are quite a lot of Q/A on this, but I couldn't find a concrete answer. Hence the question. I'm writing a screen sharing application. Now I want to turn that application to windows service. which I already did with. Apparently, the application works like this. When the counter party sends the screenshots, the application receives it and parses the data to RGB and shows on a window renderer. Because now its a service, although it receives the data, i believe that it may not be able to open renderer in the current desktop due to session isolation, the way to get around this would be to use IPC between Desktop App an the service. However, it makes it complected. Is there any simple way to solve this problem?

Related

C++ way of detecting powerstate changes in Windows for a desktop app

I've been looking everywhere for some information as to how one might go about registering for power state changes in a C++ application. I don't have a window handle and the program does not always run in as a service. I see that there are powerstate broadcasts available to register for but I cant seem to find anyway to get to them. Any one have any idea?
Once I've received a power state change, I plan on informing all connected users to that machine.

control a Qt/C++/QML GUI application running on a embedded device from a remote client application?

Scenario:
We have a Qt application(Qt 5.9.5,C++,QML,Ubuntu) running on a device (deals with telecommunications), which can also be viewed in a browser using webserver. All the operations done manually on the device have been visualized on the browser simultaneously.
Requirement: Now what we want to achieve is build a similar application(maybe web application) so that you execute it from a browser and simultaneously the application on the device should execute by itself. The device is just switched on initially. everything should be operated from the client application. What are the possible options?
We have started with Qt Remoteobjects to make a remote application but Qt version of device is older one when compared with Qt version of some functionalities in remote objects module. so using remote objects is not possible now.
Can Qt WebGL streaming helpful in this case?
Does QtWebchannel and websockets help by setting up communication with html/javascript application. Is it a possible solution?
Is virtual network computing (VNC) an option to think about in my scenario?
I have come across some concepts like Qt for WebAssembly, Web toolkit(Wt), Emscripten, Cutelyst web-framework, Qt for Automation - MQTT,OPC UA, KNX, CoAP . Do these really help at any point while developing a client application to control the QML GUI on a telecom. device?
Which of the options suits my scenario?
I have been following Qt's blogs about these related topics. Still not sure which method is suitable?
Sorry for a lengthy explanation. Kindly provide some suggestions.
Thank you.

Web service to interact with running electron app

I looking for some advice on the best way to set up a project. Not sure if this is the right place to ask but I will give it a go.
I am looking to create a "Smart Mirror". I know there are options already available for this but I want to go through the process of creating my own.
I have created the UI using electron and I am using this on a raspberry pi 3b+ using raspian stretch.
Now this is where my knowledge is lacking, due to no experience and not sure if what search terms to look for.
I would like to create a plug in on Chrome(used on my mobile phone) or a process that runs separately, to say "Send page/video to Smart Mirror". What I envisage is that this plug in will copy the URL for the page or the video and send this via a web service call. The running electron app on my raspberry pi will receive this call and process the URL and then display the page/video within a portion of the application.
I have only ever consumed a web service from within an application.
I am not sure how to set this up. Can my electron app be set up to receive this call? If so what search terms should I be looking for?
I hope this makes sense.
Please let me know your thoughts or if I am thinking about this all wrong

sending simple int from UWP app to another program

I'm lost at a seemlingly minor problem. I have a UWP app from windows samples, which counts the faces detected by the camera. I want that app to send that number to another program. I've tried doing it by clipboard, however as the other program is constantly checking the clipboard it wouldn't work.
Then I thought of a simple socket connection but I can't seem to get it working in UWP as all infos seem to be in C# not C++.
Can someone gimme a hint how to send a single int over a tcp socket to another client?
Or any other suggestions how to achieve that?
I'm really desperate...
thanks in advance.
In UWP, app services are the standard way of communicating between apps. You need to create an app service in the source app then consume the service in the second one. The app service also can be consumed by non-UWP apps.

Do I want an embedded web-server, or what?

So, someone want me to hack some code for him. He has a 42" TFT display on which he will display some application/business related data.
However, 75% of the screen real estate is unused, so he wants to fill it with "TV/adverts/flash/you know, that kind of thing... web based....".
Any advice? Do I want an embedded web-server? If so, which? (he wants free & open source, or as cheap as possible) Do I display it in a browser? (duh! probably, dude) But I don't want/need a menu, address bar, toolbar, etc - it should be full screen (does that mean "kiosk mode"?).
Sorry, folks, the requirements are not clear, but I hope that you can guess what he probably means (he is not very techie). How should I proceed with this? Thanks.
I am working on such a display system, although ours already quite evolved, with support for multi-screen, multi-user and a lot more.
A few hints :
We use firefox with the "full fullscreen" extensiton (https://addons.mozilla.org/fr/firefox/addon/1568) that allows to not display any menu bar, status bar etc. and to automatically start Firefox in that mode. Then you just need a startup script to launch firefox specifying the right URL when the machine is started.
Our system is web based, but as a multiscreen system it has one server and several client PCs connected to the server via HTTP, and each one to a TFT screen via VGA cables. If you have only one screen you could install the browser and the web server on the same machine. Only restriction : we use wake-on-lan from the server to the clients to automatically start the display every morning. This will not be possible with a single machine system !
To give you some ideas, the display mechanism basically works like that : first, the browser loads a html page with lots of javascript (that javascript constitutes what we will call the "client application".) This client application is written using the Prototype.js library (just an indication, there are many other possibilities). Then the client application asks the server for the content to be displayed. That content is passed as a JSON stream representing a playlist of objects (images, videos, text news, etc.). The client app displays each object in the playlist sequentially. The objects stay displayed for a specific duration (lots of setTimeout in the code). The transitions use effects from the Scriptaculous library (fade-in, fade-out...). When all objects have been shown, the client asks the server again for the playlist (in case changes have been made), and the process starts again. There is actually never a full reload of the page.
Then we also have a multi-content mode, where the screen is separated in various zones that are updated separately.
For one machine and a realtively static system (i.e. no GUI to add content), maybe you could implement that mechanism in a local site accessed via file://... The whole "intelligence" of the system would be in the javascript. That would save you the server part. I see one possible restriction : I think flash can't play video files from the client's machine (security restriction) so check this if you plan to use flash videos.
Well, I hope these few ideas can help you. Good luck !
Get one these
They offer a VESA mount for it I think if the screen your using supports that.
Full screen firefox would be one option.
A more flexible option would be a full screen QT app written in the language of your choice using the webkit widget for display, this would likely make flash content more difficult.
As for the content, i would put a LAMP setup on the fit pc. Build the web page using whatever feeds you want and just display the web page aka http://localhost
Alternatively you could host the "web parts" of the display on a standard web hosting server and display the data coming in on RS-422 in a separate QT widget.