I am trying to find an opportunity to transform a desktop application into a web application. For example, a desktop application opens on a server (say, written on a pure Win32 API), from which an HTML page is created using some GUI-proxy, with all the controls available in the desktop application. When interacting with these controls, the web application sends AJAX requests to the server, where some kind of "GUI-proxy" sends information about the action to the desktop-application and in response sends the response of the desktop-application to this action.

I wrote how I imagine the possibility of converting a desktop application to a web application. I admit that writing can be complete nonsense. If you know something about this topic, please help.

    3 answers 3

    Ideally, such a conversion in full is impossible. But there is one way: to do something like a kind of VNC: the application runs on the server .. it draws itself, and its image is sent to the client .. in the browser you can display this image .. you can send an AYAX request to the server by clicking the mouse, and there generated a synthetic event-click on the window. And if the application changes its appearance, you can use Comet to redraw the application image on the client. The second option is to use a real VNC and use a VNC client in a browser, for example, in Java (there are already ready applets).

      andruxa offered an interesting solution, but I will go further and suggest that you write your analogue gdi32.dll, winuser.dll and put it in the same folder as the application. DLLs in the same folder are used earlier than the system ones (if I'm not mistaken), and in these DLLs implement the output in HTML / XUL and give it to the user upon request. That's just going to be complicated with GUI applications where the output speed is more and more often than client requests - you risk skipping the animation ...

        If knowing the window descriptor (and it is possible to recognize it) it is possible to list all controls on it, then the problem is solved in some form. Would know how to list - would say :)

        • This solution is unreliable. In addition, not every application can be processed this way. EnumerateWindowsEx (or something so called) will allow you to find controls only if they are decorated accordingly in the form of windows. In addition to everything, if an application changes something in its display on its own initiative, then it will be very difficult if it starts to change the composition of controls on the go. And in any case, Comet can not do. - cy6erGn0m