SINGLEINSTANCE Attribute | singleInstance Property

Sets or gets a value that indicates whether only one instance of the specified HTML Application (HTA) can run at a time.

Syntax

HTML <HTA:APPLICATION SINGLEINSTANCE = bOpen... >
Scripting [ bOpen = ] HTA:APPLICATION.singleInstance

Possible Values

bOpen A Boolean that specifies one of the following values.
yes
Only one instance of the specified application can run at a time.
no
Default. Multiple instances of the specified application can run at the same time.

The property is read-only. The property has a default value of no.

Remarks

Note  The singleInstance property is read-only; however, the SINGLEINSTANCE attribute can be used to set the initial value.

When set to true, the singleInstance property checks the value of the applicationName property before it launches an instance of the application. For this check to be valid, the applicationName property must have a unique value assigned to it. You can use the applicationName property to identify a single application, regardless of the URL used to access it.

Example

This example shows how to get the singleInstance property.


<HTML>
<HEAD>
   <HTA:APPLICATION ID="oHTA"
    APPLICATIONNAME="myApp"
    SINGLEINSTANCE="yes"
   >
   <SCRIPT>
      alert("singleInstance    = " + oHTA.singleInstance);
   </SCRIPT>
</HEAD>
<BODY SCROLL="no">

</BODY>
</HTML>

Code example: http://samples.msdn.microsoft.com/workshop/samples/author/hta/hta_allEX.hta

Applies To

HTA:APPLICATION

See Also

Introduction to HTML Applications (HTAs)

Community Additions

Show:
© 2014 Microsoft