Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ActiveX security settings detection in SP2

27 views
Skip to first unread message

ph0ngwh0ng

unread,
Oct 1, 2004, 8:56:04 AM10/1/04
to
Hi!

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.

0 new messages