Hi Jim
Try the following
<code>
Public Enum INTERNETFEATURELIST
FEATURE_OBJECT_CACHING = 0
FEATURE_ZONE_ELEVATION = 1
FEATURE_MIME_HANDLING = 2
FEATURE_MIME_SNIFFING = 3
FEATURE_WINDOW_RESTRICTIONS = 4
FEATURE_WEBOC_POPUPMANAGEMENT = 5
FEATURE_BEHAVIORS = 6
FEATURE_DISABLE_MK_PROTOCOL = 7
FEATURE_LOCALMACHINE_LOCKDOWN = 8
FEATURE_SECURITYBAND = 9
FEATURE_RESTRICT_ACTIVEXINSTALL = 10
FEATURE_VALIDATE_NAVIGATE_URL = 11
FEATURE_RESTRICT_FILEDOWNLOAD = 12
FEATURE_ADDON_MANAGEMENT = 13
FEATURE_PROTOCOL_LOCKDOWN = 14
FEATURE_HTTP_USERNAME_PASSWORD_DISABLE = 15
FEATURE_SAFE_BINDTOOBJECT = 16
FEATURE_UNC_SAVEDFILECHECK = 17
FEATURE_GET_URL_DOM_FILEPATH_UNENCODED = 18
FEATURE_ENTRY_COUNT = 19
End Enum
<DllImport("urlmon.DLL")> _
Public Shared Function CoInternetSetFeatureEnabled(ByVal featureEntry As
INTERNETFEATURELIST, ByVal dwFlags As Integer, ByVal fEnable As Boolean) As
Integer
End Function
<DllImport("urlmon.DLL")> _
Public Shared Function CoInternetIsFeatureEnabled(ByVal featureEntry As
INTERNETFEATURELIST, ByVal dwFlags As Integer) As Integer
End Function
Private Sub SetFeatureEnabled()
Dim lr As Integer = 0
Dim featureToEnable As INTERNETFEATURELIST =
INTERNETFEATURELIST.FEATURE_WEBOC_POPUPMANAGEMENT
If CoInternetSetFeatureEnabled(featureToEnable,
SET_FEATURE_ON_PROCESS, True) = 0 Then
' Check to make sure that the API worked as expected
If CoInternetIsFeatureEnabled(featureToEnable,
SET_FEATURE_ON_PROCESS) <> 0 Then
lr = 2
End If
Else
' The API returned an error while enabling pop-up management
lr = 1
End If
End Sub
</code>
Calling SetFeatureEnabled runs without error, although I haven't attempted
to check whether the browser then behaves as you expect. It does, however,
load the page that I subsequently navigate to.
HTH
Charles
"Jim Hubbard" <(E-Mail Removed)> wrote in message
news:Eh3qd.37929$(E-Mail Removed)...
>I want to implement the same type of activeX restrictions in my browser
> application that the new SP2 for XP places in Internet Explorer.
>
> I have found 2 web pages dealing with this functionality
> (http://msdn.microsoft.com/library/de...EATURELIST.asp
> and
> http://msdn.microsoft.com/library/de...tomization.asp)
> but I am at a loss as to how to implement this functionality in VB.Net or
> C#.
>
> I tried adding urlmon.dll to my VB.Net project as a reference to use the
> CoInternetSetFeatureEnabled functionality (see
> http://msdn.microsoft.com/library/de...ureenabled.asp),
> but Visual Studio will not allow it. I get, in part, "This is not a valid
> assembly or COM component." when I try and add it to my project.
>
> Any help in implementing this type of functionality would be greatly
> appreciated.
>
> VB.Net is the language I am most familiar with, but C# examples would also
> be helpful. I will re-write the app in C# if needed.
>
>
>