detecting if an activeX is installed

NickMalloy
NickMalloy used Ask the Experts™
on
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

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
GanapathiFacets Developer

Commented:
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

NickMalloySystems Lead

Author

Commented:
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.
Facets Developer
Commented:
You could see several folders under "HKEY_CLASSES_ROOT". They are the ProgIDs. You need to pass it.

E.g: Under HKEY_CLASSES_ROOT there are Excel.Addin and Excel.Chart folders. That is what the Prog IDs.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial