CoInternetSetFeatureEnabled function
Enables or disables a specified feature control.
Syntax
HRESULT CoInternetSetFeatureEnabled( INTERNETFEATURELIST FeatureEntry, _In_ DWORD dwFlags, BOOL fEnable );
Parameters
- FeatureEntry
-
A value from the INTERNETFEATURELIST enumeration that indicates the feature control to enable or disable.
- dwFlags [in]
-
Specifies where to set the feature control value. Can be one of the following values:
- fEnable
-
A BOOL that indicates that the feature control specified by FeatureEntry is enabled when fEnable is TRUE.
Return value
Returns one of the following values.
| Return code | Description |
|---|---|
|
Success. |
|
FeatureEntry is invalid. |
Remarks
The SET_FEATURE_ON_PROCESS flag is available for all values of INTERNETFEATURELIST except FEATURE_LOCALMACHINE_LOCKDOWN. All other values of dwFlags are available only when FeatureEntry is FEATURE_LOCALMACHINE_LOCKDOWN or FEATURE_PROTOCOL_LOCKDOWN.
The CoInternetSetFeatureEnabled function was introduced in Microsoft Internet Explorer 6 for Windows XP Service Pack 2 (SP2).
Examples
This code snippet enables pop-up management behavior for the process. The code is placed inside an application that uses the WebBrowser Control before the navigation command.
LRESULT lr = 0;
INTERNETFEATURELIST featureToEnable = FEATURE_WEBOC_POPUPMANAGEMENT;
if (SUCCEEDED(CoInternetSetFeatureEnabled(featureToEnable, SET_FEATURE_ON_PROCESS, true)))
{
//Check to make sure that the API worked as expected
if (FAILED(CoInternetIsFeatureEnabled(featureToEnable,SET_FEATURE_ON_PROCESS)))
{
lr = 2;
}
}
else
{
//The API returned an error while enabling pop-up management
lr = 1;
}
Requirements
|
Minimum supported client |
Windows XP with SP2 |
|---|---|
|
Minimum supported server |
Windows Server 2003 |
|
Product |
Internet Explorer 6.0 |
|
Header |
|
|
Library |
|
|
DLL |
|