Link to home
Start Free TrialLog in
Avatar of NickMalloy
NickMalloyFlag for United States of America

asked on

detecting if an activeX is installed

I'm trying to check if the users have a certain ActiveX installed on there machine. I have found several versions of code My question is what do I put into prodId or Control to find the appropriate ActiveX? I've tried what I though might be it, but it doesn't seem to work. Where do I find the information to plug in?

function AXOrNull(progId) {
  try {
    return new ActiveXObject(progId);
  }
  catch (ex) {
    return null;
  }
}

Open in new window


To

 var plugin = navigator.plugins["control"];
            if (plugin) {
                // Contoso control is installed and enabled
                $("#open").hide();
            } else {
                try {
                    plugin = new ActiveXObject("control");
                } catch (e) {
                    // Contoso control is not installed or disabled
                    $("#open").show("slow");
                }
            }

Open in new window

Avatar of Ganapathi
Ganapathi
Flag of India image

I hope you are detecting a particular ActiveX installed on the system.

You should pass the AcriveX control name of the one you are searching for.

Every ActiveX has different names which you should know by searching on the internet OR by installing the ActiveX in your machine and find the name from Registry under "HKEY_CLASSES_ROOT".

Example:

Excel.Application
Excel.Chart
Scripting.FileSystemObject
WScript.Shell
Word.Document

AXOrNull("Excel.Chart")

function AXOrNull(progId) {
  try {
    return new ActiveXObject(progId);
  }
  catch (ex) {
    return null;
  }
}

Open in new window

Avatar of NickMalloy

ASKER

yes, I'm looking for a certain one. when looking under "HKEY_CLASSES_ROOT". how do I know what maps to the Active X listed in IE. I don't see anything in the root of "HKEY_CLASSES_ROOT". that matches something listed in IE, expect the ClassID, but I don't see where a name is listed.
ASKER CERTIFIED SOLUTION
Avatar of Ganapathi
Ganapathi
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial