Creating Web Applications In Windows

What Do You Mean Web Applications?

As you read this article right now more than likely you are using what we like to call a desktop application or possibly a mobile application. These forms of applications are based on code that is installed on a device like your laptop or smart phone. Now these applications are wonderful treasures and can do many, but they usually have one major downfall: they take forever to develop. Desktop applications can require rigorous development and physical resources in personnel that making a website might not. Key word here is website. Web development has traditionally been known to be easier to develop because of the simplicity that we associate with them. Now, I can tell you quite honestly that I’ve seen websites so advanced they would trump and desktop application, but we’re not here to debate such matters. A website itself can be seen as an application. It does perform an action, it may not be much but it does. The most simple websites display information and more advanced examples will pay your bills, order pizza, or perform ridiculous calculations.  I would define the term web application as any website built specifically to perform a certain action.

Windows? Isn’t That A Desktop OS?

Yes, Windows is very much a desktop operating system and no we’re not building a desktop application, but we’re going to make this work. As we mentioned previously desktop applications can be troublesome and websites can be easy. So how do we put a website on a desktop? The answer is called in the Microsoft world as an HTML Application or by it’s file extension HTA. Before you get worrier that you’ll have to learn a new language or buy some expensive piece of software I assure you it is not that case. These HTAs have actually been around since 1999 but since we were too busy figuring out Y2k we got stuck in the developers dark age and we lost sight of things for about 5 years. HTAs are actually HTML files with a different extension and one extra HTML node in the head section of the file. Easy right? For easy static sites like an intranet in an office or for kiosks that display information this solution is ideal. With more dynamic sites it can get trickier but we’ll save that for another day.

So Show Me!

Now remember there is no special language you need to learn or software to do this just simply place the following code inside the head tag of your website and changed the file extension to .hta.

Each of the parameters are fairly self explanatory, but if you need further reference please read the MSDN article to learn more. Now what exactly does this get you? In reality, all you have is a modified web page, but in fact it is more useful than just a web page. By creating a HTA one can access local files without having annoying prompts about security warnings. This means you can use jQuery and ActiveX to pull local data, directories and make use of them in your application. And, as I mentioned before some times all you need is a simple website rather than a full desktop application. By creating an HTA you can do this without much of a headache.