spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / experts / javascript / column39


IE 5.0 Review, Part V: HTML Applications (HTAs) (6)

KRONOS Technical Analyst
Professional Technical Resources
US-OR-Portland

Justtechjobs.com Post A Job | Post A Resume
Developer News
Mandrake Linux Founder Back, Virtually
Amazon: We're a Technology Company
Sun Expands MySQL With Closed Source

Customizing HTAs

You have previously seen the HTA's window. Click here to examine it again. This window can be further customized to your taste by the HTA:APPLICATION tag. Its attributes tell the window how to appear and behave as an application. The HTA:APPLICATION tag should be included in the <HEAD> section of the HTA. Let's take an example:

<HEAD>
  <TITLE> My Simple Application</TITLE>
  <HTA:APPLICATION ID = "htaObj"
     APPLICATOINNAME = "docjavascript"
     BORDER = "none"
     CAPTION = "no"
     SHOWINTASKBAR = "yes"
     SINGLEINSTANCE = "yes"
     SYSMENU = "no"
     WINDOWSTATE  = Maximize
  >
</HEAD>

All attributes can be accessed from JavaScript via an HTA object identified by the ID attribute. The following script prints the name of the HTA application:

<HTML>
<HEAD>
  <TITLE> My Simple Application</TITLE>
  <HTA:APPLICATION ID = "htaObj"
     APPLICATIONNAME = "docjavascript"
  >
</HEAD>
<SCRIPT>
      alert("applicationName = " + htaObj.applicationName);
   </SCRIPT>
<BODY>
This is Doc JavaScript's HTA<BR>
<BUTTON onclick="self.close()">Go Away</BUTTON>
</BODY>
</HTML>

The following table summarizes all attributes and properties and how they affect the look and feel of the HTA window:


HTML AttributeAPPLICATIONNAME
DescriptionSets (retrieves in JavaScript) the application name.
Possible ValuesA String
ExamplesAPPLICATIONNAME= "docjavascript"
RemarksMust be set and unique for the SINGLEINSTANCE to work.
JavaScript PropertyapplicationName
PermissionRead Only
DefaultNo
HTML AttributeBORDER
DescriptionSets or retrieves the HTA border.
Possible Values"thick", "dialog window", "thin", "none"
ExamplesBORDER= "thin"
RemarksOnly valid for HTA windows that contain a title bar, or caption. The value "none" eliminates the program icon and Minimize/Maximize buttons. Can be used with the borderStyle property, which controls the content border within the window. Differences may not be detected.
JavaScript Propertyborder
PermissionRead Only
Default"thick"
HTML AttributeBORDERSTYLE
DescriptionSets or retrieves the HTA content border.
Possible Values"normal", "complex", "raised", "static", "sunken"
ExamplesBORDERSTYLE= "normal"
RemarksAffects only the content border. Use BORDER to affect the outer border of the window.
JavaScript PropertyborderStyle
PermissionRead Only
Default"normal"
HTML AttributeCAPTION
DescriptionSets or determines whether the HTA window has a title bar.
Possible Values"yes", "no"
ExamplesCAPTION = "yes"
RemarksTurning off the caption will remove the application icon, and the Minimize and Maximize buttons. Provide a button to exit the application!
JavaScript Propertycaption
PermissionRead Only
Default"yes"
HTML AttributecommandLine
DescriptionRetrieves the command line and arguments that invoked the HTA.
Possible ValuesRead Only
Examplescommand = htaObj.commandLine
RemarksReturns an empty string when HTA invoked via HTTP.
JavaScript PropertycommandLine
PermissionRead Only
DefaultNo Default
HTML AttributeICON
DescriptionSets or retrieves the icon file name.
Possible ValuesA String
ExamplesICON = "3DSmiley.ico"
RemarksNeed to use a 32x32 icon.
JavaScript Propertyicon
PermissionRead Only
DefaultSystem Application Icon
HTML AttributeMAXIMIZEBUTTON
DescriptionSets or determines whether the HTA window has a Maximize button.
Possible Values"yes", "no"
ExamplesMAXIMIZEBUTTON = "yes"
RemarksMust turn on CAPTION to have the Maximize button.
JavaScript PropertymaximizeButton
PermissionRead Only
Default"yes"
HTML AttributeMINIMIZEBUTTON
DescriptionSets or determines whether the HTA window has a Minimize button.
Possible Values"yes", "no"
ExamplesMINIMIZEBUTTON = "yes"
RemarksMust turn on CAPTION to have the Maximize button.
JavaScript PropertyminimizeButton
PermissionRead Only
Default"yes"
HTML AttributeSHOWINTASKBAR
DescriptionSets or determines whether the HTA appear in the task bar.
Possible Values"yes", "no"
ExamplesSHOWINTASKBAR = "yes"
RemarksDoes not affect the applications shown by ALT+TAB
JavaScript PropertyshowInTaskBar
PermissionRead Only
Default"yes"
HTML AttributeSINGLEINSTANCE
DescriptionSets or determines whether only one instance of the application is allowed.
Possible Values"yes", "no"
ExamplesSINGLEINSTANCE = "no"
RemarksApplication is determined by APPLICATONNAME and not by the URL. Click twice on the links to the left.
JavaScript PropertysingleInstance
PermissionRead Only
Default"no"
HTML AttributeSYSMENU
DescriptionSets or determines whether the HTA has system menus (icon and Maximize and Minimize buttons).
Possible Values"yes", "no"
ExamplessysMenu = "yes"
RemarksCan drastically affect the look and feel of the application.
JavaScript PropertysysMenu
PermissionRead Only
Default"yes"
HTML AttributeVERSION
DescriptionSets or determines the HTA version.
Possible ValuesA String
Examplesversion = "5.3"
RemarksThe entered version will appear in the application's properties, if you save to disk.
JavaScript Propertyversion
PermissionRead Only
Default""
HTML AttributeWINDOWSTATE
DescriptionSets or determines the HTA window size.
Possible Values"normal", "maximize", "minimize"
ExamplesWINDOWSTATE = "minimize"
Remarks"normal" means window will inherit the Internet Explorer default window. "maximize" will expand the window to a full screen. "minimize" will put the application icon on the task bar.
JavaScript PropertywindowState
PermissionRead Only
Default"normal"


http://www.internet.com

Produced by Yehuda Shiran and Tomer Shiran

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Whitepapers and eBooks

Intel Whitepaper: Comparing Two- and Four-Socket Platforms for Server Virtualization
IBM Solutions Brief: Go Green With IBM System xTM And Intel
HP eBook: Simplifying SQL Server Management
IBM Contest: Are You the Next Superstar? Join the "Search for the XML Superstar" Contest to Find Out
Microsoft PDF: Top 10 Reasons to Move to Server Virtualization with Hyper-V
Microsoft PDF: Six Reasons Why Microsoft's Hyper-V Will Overtake Vmware
Microsoft Step-by-Step Guide: Hyper-V and Failover Clustering
Intel PDF: Quad-Core Impacts More Than the Data Center
Intel PDF: Virtualization Delivers Data Center Efficiency
Go Parallel Article: PDC 2008 in Review
Microsoft PDF: Top 11 Reasons to Upgrade to Windows Server 2008
Avaya Article: Communication-Enabled Mashups: Empowering Both Business Owners and IT
Intel Whitepaper: Building a Real-World Model to Assess Virtualization Platforms
  PDF: Intel Centrino Duo Processor Technology with Intel Core2 Duo Processor
Microsoft Article: Build and Run Virtual Machines with Hyper-V Server 2008
Go Parallel Article: Q&A with a TBB Junkie
IBM Whitepaper: Innovative Collaboration to Advance Your Business
Internet.com eBook: Real Life Rails
IBM eBook: The Pros and Cons of Outsourcing
Internet.com eBook: Best Practices for Developing a Web Site
IBM CXO Whitepaper: The 2008 Global CEO Study "The Enterprise of the Future"
Avaya Article: Call Control XML in Action - A CCXML Auto Attendant
IBM CXO Whitepaper: Unlocking the DNA of the Adaptable Workforce--The Global Human Capital Study 2008
Adobe Acrobat Connect Pro: Web Conferencing and eLearning Whitepapers
HP eBook: Guide to Storage Networking
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
webref The latest from WebReference.com Browse >
Popular JavaScript Framework Libraries: An Overview - Part 3 · Accessing Your MySQL Database from the Web with PHP · Working with the DOM Stylesheets Collection
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Crucial Triples Up With New Three-Channel DDR3 Kits · Meet the Finalists: Excellence in Technology Awards · Tealeaf Offers Insight to Mobile Customer Behavior


Created: May 12, 1999
Revised: May 12, 1999

URL: http://www.webreference.com/js/column39/customize.html