title: How do I programmatically determine if an ActiveX control has been installed, and whether it or ActiveX as a whole has been disabled?
body: <p>I'm using ASP.NET on the server side and JavaScript on the client side.</p>
  
  <p>I'm trying to develop some pages that will help the user troubleshoot and I was wondering if there was a way to programmatically determine the following:</p>
  
  <ol>
  <li>if ActiveX has been disabled in Internet Explorer</li>
  <li>if an ActiveX control has been installed</li>
  <li>if an ActiveX control has been installed but disabled</li>
  </ol>
  
  <p>For cases 2 and 3, I know that in order to detect that an ActiveX control is installed, you would use the following check in JavaScript:</p>
  
  <pre><code>function isActiveXControlInstalled(progId, expectedVersion)
  {
      var version;
      try
      {
          var instance = new ActiveXObject(progId);
          version = instance.VersionString;
          instance = null;
      }
      catch (e)
      {
         version = null; // Set version to null, since that is an invalid control version, and the check below will always fail.
      }
  
      return (version &gt;= expectedVersion);
  }
  </code></pre>
  
  <p>However, this function also returns false in the case that the control is installed but disabled. Can these two cases be distinguished?</p>