HTA:APPLICATION Element | HTA:APPLICATION Object
Enables an extended object model for building HTML Applications (HTA).
Members Table
The following table lists the members exposed by the HTA:APPLICATION object.
Attribute Property Description APPLICATIONNAME applicationName Sets or gets the name of the HTML Application (HTA).
BORDER border Sets or gets the type of window border for the HTML Application (HTA).
BORDERSTYLE borderStyle Sets or gets the style set for the content border in the HTML Application (HTA) window.
CAPTION caption Sets or gets a Boolean value that indicates whether the window is set to display a title bar or a caption, for the HTML Application (HTA).
commandLine Gets the argument used to launch the HTML Application (HTA).
CONTEXTMENU contextMenu Sets or gets a string value that indicates whether the context menu is displayed when the right mouse button is clicked.
ICON icon Sets or gets the name and location of the icon specified in the HTML Application (HTA).
INNERBORDER innerBorder Sets or gets a string value that indicates whether the inside 3-D border is displayed.
MAXIMIZEBUTTON maximizeButton Sets or gets a Boolean value that indicates whether a Maximize button is displayed in the title bar of the HTML Application (HTA) window.
MINIMIZEBUTTON minimizeButton Sets or gets a Boolean value that indicates whether a Minimize button is displayed in the title bar of the HTML Application (HTA) window.
NAVIGABLE navigable Sets or gets a string value that indicates whether linked documents are loaded in the main HTML Application (HTA) window or in a new browser window.
SCROLL scroll Sets or gets a string value that indicates whether the scroll bars are displayed.
SCROLLFLAT scrollFlat Sets or gets a string value that indicates whether the scroll bar is 3-D or flat.
SELECTION selection Sets or gets a string value that indicates whether the content can be selected with the mouse or keyboard.
SHOWINTASKBAR showInTaskBar Sets or gets a value that indicates whether the HTML Application (HTA) is displayed in the Windows taskbar.
SINGLEINSTANCE singleInstance Sets or gets a value that indicates whether only one instance of the specified HTML Application (HTA) can run at a time.
SYSMENU sysMenu Sets or gets a Boolean value that indicates whether a system menu is displayed in the HTML Application (HTA).
VERSION version Sets or gets the version number of the HTML Application (HTA).
WINDOWSTATE windowState Sets or gets the initial size of the HTA window.
Remarks
Warning HTAs can potentially expose the client machine to malicious script. HTAs, like .exe files have read/write access to the files and system registry on the client machine. Powerful executables can be produced and delivered quickly with a few short script statements. Use of HTAs is not recommended where security or the source of the file is questionable.
You can create an HTA by saving an existing HTML page with an .hta extension. However, to set application window properties, such as those listed in the Members table, include the HTA:APPLICATION tag within the head element.
The HTA:APPLICATION element requires a closing tag.
<HTA:APPLICATION ... > ... </HTA:APPLICATION>
Because the HTA:APPLICATION element is an empty tag, it can also be closed using the following shortcut.
<HTA:APPLICATION ... />
Note When using the shortcut, the forward slash must be preceded by a blank space.
This element is not rendered.
This element requires a closing tag.
Example
This example retrieves all the properties exposed by HTA:APPLICATION.
<HTML> <HEAD> <TITLE>HTA Demo</TITLE> <HTA:APPLICATION ID="oHTA" APPLICATIONNAME="myApp" BORDER="thin" BORDERSTYLE="normal" CAPTION="yes" ICON="" MAXIMIZEBUTTON="yes" MINIMIZEBUTTON="yes" SHOWINTASKBAR="no" SINGLEINSTANCE="no" SYSMENU="yes" VERSION="1.0" WINDOWSTATE="maximize"/> <SCRIPT> /* This function also retrieves the value of the commandLine property, which cannot be set as an attribute. */ function window.onload() { sTempStr = "applicationName = " + oHTA.applicationName + "\n" + "border = " + oHTA.border + "\n" + "borderStyle = " + oHTA.borderStyle + "\n" + "caption = " + oHTA.caption + "\n" + "commandLine = " + oHTA.commandLine + "\n" + "icon = " + oHTA.icon + "\n" + "maximizeButton = " + oHTA.maximizeButton + "\n" + "minimizeButton = " + oHTA.minimizeButton + "\n" + "showInTaskBar = " + oHTA.showInTaskbar + "\n" + "singleInstance = " + oHTA.singleInstance + "\n" + "sysMenu = " + oHTA.sysMenu + "\n" + "version = " + oHTA.version + "\n" + "windowState = " + oHTA.windowState + "\n" ; oPre.innerText = sTempStr; } </SCRIPT> </HEAD> <BODY SCROLL="no"> <PRE ID=oPre> </PRE> </BODY> </HTML>
Code example: https://samples.msdn.microsoft.com/workshop/samples/author/hta/hta_allEX.hta
See Also