Html Application - HTA

29/07/2009 10:01

 

 

 

An HTML Application (HTA) is a Microsoft Windows application written with HTML and Dynamic HTML. The ability to write HTAs was introduced with Microsoft Internet Explorer 5.0.

HTAs can be made from regular HTML files by simply changing the file extension to .hta. To customize the appearance of an HTA, a new tag, with attributes, is introduced: <hta:application ...>. This tag appears in the <head>...</head> section of an HTA document.

A regular HTML file is confined to the security model of the web browser i.e. to communicating with the server, manipulating the page's object model (usually to validate forms and/or create interesting visual effects) and reading/writing cookies. An HTA runs as a fully trusted application and therefore has more privileges than a normal HTML file — for example an HTA can create/edit/remove files and registry entries.

     Because an HTA has more privileges than an HTML page, it cannot be executed via HTTP. Rather, the HTA must be downloaded (just like an EXE file) and executed from local file system.

    HTA or Html Application have the .hta extension. If you have a webpage, you can save that to .hta extension but HTA  has its corresponding code that can be embedded in html code which is place on the <head></head> section.

eg. Example 1

<html> 

<head>

<HTA:APPLICATION
     ID="Romans"
     VERSION="1.01"
     APPLICATIONNAME="Romans"
     CONTEXTMENU="no"
     SCROLL="no"
     SINGLEINSTANCE="yes"
     WINDOWSTATE="maximize"
>

<head>

<body>

//code goes here.

<body>

<html>

 

eg. Example 2 - Now we can add some javascript, vbscript, css script which HTA support.

<html> 

<head>

<script language="javascript>

//codes goes here.

</script>

<script language="vbscript">

//codes goes here.

</script>

<style type="text/css">

//codes goes here.

</style>

<HTA:APPLICATION
     ID="Romans"
     VERSION="1.01"
     APPLICATIONNAME="Romans"
     CONTEXTMENU="no"
     SCROLL="no"
     SINGLEINSTANCE="yes"
     WINDOWSTATE="maximize"
>

<head>

<body>

//code goes here.

<body>

<html>

Back