I want to know if ActiveX controls execution is enabled in WinXP SP2.
I have managed a way, which is demonstrated in the following VBS
function:
Function isActiveXEnabled()
isActiveXEnabled = -1
On error resume next
Set flp = CreateObject("MSComctlLib.TabStrip.2")
if IsObject(flp) then
isActiveXEnabled = 1
Exit Function
End If
Set flp = CreateObject("HotSpot")
if IsObject(flp) then
isActiveXEnabled = 1
Exit Function
End If
Set flp = CreateObject("DirectAnimation.StructuredGraphicsControl")
if IsObject(flp) then
isActiveXEnabled = 1
Exit Function
End If
Set flp = CreateObject("MSWebDVD.MSWebDVD.1")
if IsObject(flp) then
isActiveXEnabled = 1
Exit Function
End If
Set flp = CreateObject("Internet.HHCtrl.1")
if IsObject(flp) then
isActiveXEnabled = 1
Exit Function
End If
Set flp = CreateObject("WMPlayer.OCX.7")
if IsObject(flp) then
isActiveXEnabled = 1
Exit Function
End If
Set flp = CreateObject("Shell.Explorer.2")
if IsObject(flp) then
isActiveXEnabled = 1
Exit Function
End If
Set flp = CreateObject("MSCAL.Calendar.7")
if IsObject(flp) then
isActiveXEnabled = 1
Exit Function
End If
Set flp = CreateObject("ScriptBridge.ScriptBridge.1")
if IsObject(flp) then
isActiveXEnabled = 1
Exit Function
End If
Set flp = CreateObject("Sysmon.3")
if IsObject(flp) then
isActiveXEnabled = 1
Exit Function
End If
Set flp = CreateObject("Agent.Control.2")
if IsObject(flp) then
isActiveXEnabled = 1
Exit Function
End If
Set flp = CreateObject("RefEdit.Ctrl")
if IsObject(flp) then
isActiveXEnabled = 1
Exit Function
End If
isActiveXEnabled = 0
End Function
It is, as you might have noticed(!), quite non-elegant. But, it does
work on a variety of PCs. I am looking for a more elegant and surest
way to do so. With SP1, you could just do:
Function isActiveXEnabled()
isActiveXEnabled = -1
On error resume next
Set flp = CreateObject("Microsoft.ActiveXPlugin.1")
If IsObject(flp) Then
isActiveXEnabled = 1
Else
isActiveXEnabled = 0
End If
End Function
And may the discussion begin!
Alex
------------
Find a clever quote and paste it here.