CoInternetSetFeatureEnabled

Declaration

HRESULT
CoInternetSetFeatureEnabled (
    INTERNETFEATURELIST FeatureEntry,
    DWORD dwFlags,
    BOOL fEnable);

Parameters

The FeatureEntry argument tells which feature to test. The supported Internet Features are listed separately.

The dwFlags argument tells in which context to evaluate the feature. The supported Feature Enabled Flags are listed separately.

The fEnable argument is non-zero to enable the feature or zero to disable it.

Return Value

The function returns zero for success, else an error code.

Behaviour

Features are cached per-process and per-thread. If the feature cache is not already initialised for the current process, this function initialises it. Initial states for all supported features are loaded from the registry or are defaulted.

It is an error (E_FAIL) to provide a FeatureEntry that is out of range.

If dwFlags is unsupported, the function succeeds trivially.

Process

If dwFlags is SET_FEATURE_ON_PROCESS, the function sets the given feature’s per-process state for the current process, as enabled or disabled according to whether fEnable is non-zero, and succeeds.

Thread

If dwFlags is SET_FEATURE_ON_THREAD, the function sets the given feature’s per-thread state for the current thread, as enabled or disabled according to whether fEnable is non-zero, and succeeds.

Zone

Along with a per-thread state for each feature, URLMON also maintains a per-zone state for all features. If dwFlags is any of the values in the following list, then FeatureEntry is irrelevant:

Each of these values corresponds to an Internet security zone (in decreasing order of trustworthiness). The function sets the zone’s state for the current thread, as enabled or disabled according to whether fEnable is non-zero, and succeeds.

Availability

The CoInternetSetFeatureEnabled function is exported by name from URLMON.DLL in the version 6.00 from Windows XP SP2, and higher.