How can I programmatically determine if an ActiveX control is installed and disabled or ActiveX in general?
I am using ASP.NET server side and JavaScript client side.
I'm trying to develop some pages to help a user troubleshoot, and I was wondering if there is a way to programmatically determine the following:
- if ActiveX is disabled in Internet Explorer
- if an ActiveX control is installed
- if the ActiveX control is installed but disabled
In cases 2 and 3, I know that in order to detect that an ActiveX control is installed, you must use the following check in JavaScript:
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 >= expectedVersion);
}
However, this function also returns false if the control is installed but disabled. Can these two cases be distinguished?
+2
user173405
source
to share