Check whether a user has installed a software.
I. materials:
Function ocxstatus (){
VaR newobj;
Try {
Newobj = new activexobject ("tvantsx. tvantsxctrl.1 ");
If (typeof newobj! = 'Undefined '){
Newobj = NULL;
Return true;
}
} Catch (e ){
Newobj = NULL;
Return false;
}
}
Ii. Problems:
The yellow background section above looks like a component name. The problem that cannot be solved now is that you do not know the component names of each player. Currently, you only know CLSID !!!
Iii. Problem Solving:
I found a lot of information online, many of which need to know clsid. After hard searching, I finally found this code in a certain corner of a Website:
ActiveX JS can be used to call ActiveX
Page
<Object style = 'display: none ;'
Id = 'byd _ ICC 'name = 'byd _ ICC' classid = 'clsid: 4e0841cc-655f-4355-adeb-484a443fe3a7'
Codebase = 'byd _ ICCR. Cab # version =, '> </Object>
Adding ActiveX objects to the body
JS call
VaR tempcardid =
Byd_icc.getcardidbyhex (); // call actiex
If (tempcardid! = ""){
This. trreadcard. stopall ();
This. loginuser (tempcardid );
Byd_icc.clearcardid ();
Previouscardid = "";
}
This method can solve the problem by knowing the classid !!! However, after testing, the above Code is purely flawed and cannot be implemented. M's deception of my feelings.
It seems that you only have to rely on yourself.
Since classid cannot be used in code to detect whether a software is installed, why not try to see what the so-called "component name" is?
I first thought of the installation file, so I found it in the installation file and finally found it.Powerlist. ocx Install the ActiveX control in the directory. At this time, I really like it, and she is the only one. However, the tragedy is that the so-called component name is not it !!!............... After a while, I thought, sinceYesClassid and classid are in the Registry again. Why don't I try to start with the Registry !!! So I searched for the classid corresponding to the software under the CLSID directory of the Registry and finally found something called proid very familiar,The so-called component name is proid, and the registry can be queried. The following problem is easily solved. Even if you do not know the classid, be patient and find the so-called "component name" of the software in the registry, that is, proid.