Introduction
The traditional desktop-to-web transitioning process requires a large investment of time and money, and the need to perform a great amount of recoding. But you might be missing out lots of opportunities on untold numbers of potential users—users who have moved away from Windows desktops to iPads and other such devices.
As users are migrating from traditional desktops to mobile devices, transitioning your Windows application to the web is the next step to increasing your exposure. With the amount of software modifications required, this is both time consuming and expensive. Until now. Thinfinity VirtualUI delivers your Windows applications to users on any device, anywhere. All with a single line of code.
With no functional or visual compromises, you can make your Windows applications accessible from any HTML5 compatible web browser running on any platform. Enhance your existing applications with online data, rejuvenate your older software, and deliver your application to anywhere in the world, all with Thinfinity VirtualUI.
System Overview
Thinfinity VirtualUI is composed by an Http/Websockets Server, an HTML5 Javascript Client and an ActiveX Library.
- VirtualUI Server
The VirtualUI Server is an http(s)/websockets server that communicates with the Windows app through the VirtualUI Application SDK library, taking the GDI/GDI+/DirectX redirection commands to the web browser.
- VirtualUI HTML5 Client
The VirtualUI Javascript/HTML5 Client is the responsible for the actual drawing on the web-browser canvas and interacting with the end-user mouse and keyboard events.
- VirtualUI Application SDK
The VirtualUI Application SDK is a set of libraries that plugs into the developer’s programing framework to redirect Windows calls and drawing commands to the remote HTML5 canvas. It also provides an object remoting framework (jsRO) devised to ease the integration between the windows application and the web.
Execution environments
Executing the application from the Windows Shell
When the application is executed from the Windows Shell, it behaves as a standard Windows application.
Executing the application under the IDE
When the application is executed under a Development Environment (such as Microsoft Visual Studio or Embarcadero Delphi), the application GUI is still shown on the desktop, but it can also be accessed from a Web Browser.
In this mode, VirtualUI runs a Server in development mode, which allows single-user access to the running application for debugging and testing purposes.
Executing the application under VirtualUI Server
If the application is registered on a VirtualUI server, it can be launched pointing the Web Browser to the application’s assigned URL. The application’s GUI will be embedded in a web page and users will be able to interact with it as usual.
For each user accessing the application’s url, VirtualUI creates a new instance of the application and handles the simultaneous GUI input and output.
Basic programming
Any language with access to COM interfaces (ie. Visual Basic, FoxPro, Gupta, etc.) can instantiate VirtualUI.
Special source code interfaces for c#, vb.net, c++ and Delphi are provided. Here are examples of the initialization code with a single codeline:
C#
using System;
using System.Windows.Forms;
namespace MyApp
{
static class Program
{
[STAThread]
static void Main()
{
new Cybele.Thinfinity.VirtualUI().Start();
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}
Delphi
program MyApp;
uses
Windows,
Forms,
VirtualUI_AutoRun,
MyApp.Main in MyApp.Main.pas' {Form1};
{$R *.res}
begin
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.
Web-adapting the application
Thinfinity VirtualUI provides you with several objects, properties and methods to allow you prepare your application for the best end-user experience.
For instance, your application can interact with local resources by
- sending print jobs to the browser,
- allowing for file access with through local file open/save dialogs and download/upload methods.
Also gives you the necessary information to adapt your software for different form factors, orientations, etc. by accessing to
- browser’s and screen’s dimensions,
- orientation,
- user agent.
It also allows you to retrieve or persist information in browser’s cookies or provide your own authentication scheme.
Extensibility and Web Integration
Javascript Remote Objects — jsRO
jsRO allows you to increase your application’s power, extending it to the web environment. This is made possible by the publishing of data models defined programmatically from the application that expose properties, methods and events, easing the dialog between the web and the original application.
Example:
C#
ro = new JSObject("ro");
ro.Methods.Add("multiply") .AddArgument("a", IJSDataType.JSDT_FLOAT) .AddArgument("b", IJSDataType.JSDT_FLOAT) .OnCall(new JSCallback( delegate(IJSObject parent, IJSMethod Method)
{
float a, b;
a = Method.Arguments["a"].AsFloat;
b = Method.Arguments["b"].AsFloat;
Method.ReturnValue.AsFloat = a * b;
})).ReturnValue.DataType = IJSDataType.JSDT_FLOAT;
ro.ApplyModel();
Javascript
$(document).ready(function () {
var jsro = new Thinfinity.JsRO();
var ro = null;
jsro.on('model:ro', 'created', function () {
ro = jsro.model.ro;
});
function multiplyRemote(x,y) {
ro.multiply(x, y, function (result) {
alert("Result is " + result);
});
};
});
Web Components
Web Components are a new and exciting technology that takes the well known "reusable software components" concept to the web. With this HTML5 specification you can build HTML+Javascript pieces and use them as a custom HTML element.
In Thinfinity VirtualUI you can easily embed Web Components in your Windows application. Some Web Components examples are: a native video streaming component, a raw printing component, a QR component, a signature component, a Google Maps component, and so on.
Example code can be found in http://github.com/virtualui
File System and Registry Virtualization
File System Virtualization helps developers publish only relevant shared folders and provide authentication-based private folders. Additionally, shared folders can be redirected to safer places in the disk and/or be write protected.
File System Virtualization involves two steps. The first one is the File System mapping design, when the developer creates the relationship between real paths and the redirected-path tree that the end-user will see and access. The second one, the inclusion of the created mapping definition into the application program.
Registry Virtualization allows developers to store end-user information in the Windows Registry in a secure and isolated way and to provide authentication-based registry entries.
Additionally, shared registry entries can be redirected to safer places in the Windows Registry.
Similarly to File System Virtualization, Registry Virtualization also involves two steps. The first one is the mapping definition, when the developer creates the relationship between an original registry entry and a redirected registry entry. The second one, the inclusion of the created mapping definition into the application program.
Both File System Virtualization and Registry Virtualization helps developers to prepare their applications for a multi-user use, where end-users might need to have their private files and registry entries.
Conclusion
Thinfinity VirtualUI allows developers to:
- Create dual-platform Windows/HTML5 applications effortlessly, by adding only one line of code to their existing projects built in .Net (WinForms), Delphi, Visual C++ and others.
- Fully integrate their Windows application into a web application using the Javascript Remote Objects (jsRO) framework and Web Components.
- Expand applications’ availability by delivering them normally on a Windows environment, or by installing them on a Thinfinity VirtualUI Server environment to be accessed remotely from any HTML5-compliant Web browser.
- Instantly upgrade and modernize Windows-based applications.
References
Product page: http://www.cybelesoft.com/Thinfinity/VirtualUI/
Whitepaper: http://www.cybelesoft.com/docs/thinfinity_virtualui_whitepaper.pdf
Download: http://www.cybelesoft.com/download/