WebReference.com logo
tip archive  •   about  •   sitemap  •   contact  •   jobs  •   write for us  •   subscribe


[next]

The Wonderful World of Web Applications: HTML Apps (HTA)

By

Social Bookmark

Oracle Report Developer (IL)
Next Step Systems
US-IL-Elk Grove Village

Justtechjobs.com Post A Job | Post A Resume


Just as desktop PCs all but replaced mainframes in the eighties, the web application appears to be poised to supersede the traditional desktop application...or is it? The answer may well depend on who you ask. There are those who firmly believe that web apps can never fully replace the desktop application because they can't compare in speed or appearance departments. Yet, as browsers mature and new ones are introduced, web pages are becoming far more interactive and customizable than anyone had previously imagined. Similarly, network speed has been increasing at such a rapid pace, that high quality streaming movies have already become a reality. Could we be witnessing the last throes of the desktop application? It may be a bit premature to say with any certainty, but by looking at what kind of technologies currently exist for creating cutting edge web applications, we can compare them to desktop apps and reach a conclusion as to whether or not web apps may constitute a real threat to the desktop application. Today, we'll be looking at a Microsoft contribution called HTML Apps (HTA).

The Achilles heel of web apps is their restricted permissions on the client machine. By design, any process that runs within a web browser does so with limited access permissions, as to minimize the execution of malicious code. Permission levels can be customized by the user, but they tend to be quite restrictive - especially where untrusted sources are concerned. By-and-large, read, write, and execute rights are not permitted. As web applications have gained popularity, several workarounds have been introduced by vendors. Bill Gates and company have a notable advantage over the competition because they also make the most popular operating system on the planet, that of course being Windows. It should then come as no surprise that they have introduced a means of writing web applications for Internet Explorer that can bypass the usual security restrictions. Their solution is called HTML Applications or HTA for short. It encapsulates web functionality and syntax that web developers are already familiar with, plus some HTA-specific objects that provide control over GUI design and full access to the client system. Sounds promising, to be sure!

To get better acquainted with HTAs, we'll try our hand at writing a few simple ones. Although any good HTML editor will be of great assistance in the writing of HTA files, some IDEs, such as the Antechinus® JavaScript Editor, support HTA development. As such, they can help you to create the initial page template, provide choices for attributes, perform syntax checking, preview program output, and more. Unfortunately, HTA support is found mostly in professional level products. For example, a single license for the Antechinus® JavaScript Editor goes for about $50 USD. One free tool, which I can recommend is Microsoft's HTA Helpomatic program. As if to prove the value of HTA, it is itself an HTA! While it does not produce code for you like the pro editors, it does provide code samples that you can copy and paste into your own HTAs.

Creating a Basic HTA

Running an HTA works just like any executable. Double-click the hta_helpomatic.hta file in Windows Explorer to launch the program. The HTA Elements listbox, on the left, contains a number of page components for including in your HTA. There's even a basic page template to get you started:

Save the file without any changes with the .hta extension and run it by double-clicking the file name in Windows Explorer, just as you did with the HTA Helpomatic program. Figure 1 shows the screen at this point:

Figure 1

The only part of the document that distinguishes an HTA from a regular web page is the <HTA:APPLICATION> tag. It controls the appearance of the HTA window and is optional, as all of its attributes have default values. Here is a list of some of the more commonly-used ones:


[next]

Recent Articles

WebReference.com site name
Use Web Caching to Make Your Web Site Faster
Creating an Online Shopping Cart Mechanism in PHP
Log JavaScript Errors Using an AJAX-driven Web Service
internet.com site name
Configuring Granular Settings for a Database Level Audit
The Perils of a Web 2.0 Transition on Your Business Processes
Facebook Redesigns Site —Again — Nears 400M Mark



The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers