CoInternetIsFeatureEnabled function
Determines whether the specified feature control is enabled.
Syntax
HRESULT CoInternetIsFeatureEnabled( INTERNETFEATURELIST FeatureEntry, _In_ DWORD dwFlags );
Parameters
- FeatureEntry
-
A feature control from the INTERNETFEATURELIST enumeration.
- dwFlags [in]
-
Specifies where to get the feature control value from.
Return value
Returns one of the following values.
| Return code | Description |
|---|---|
|
The feature is enabled. |
|
The feature is disabled. |
|
The FeatureEntry parameter is invalid. |
Remarks
The CoInternetIsFeatureEnabled function was introduced in Microsoft Internet Explorer 6 for Windows XP Service Pack 2 (SP2).
CoInternetIsFeatureEnabledForUrl is the recommended function to use for the FEATURE_ZONE_ELEVATION feature control, the FEATURE_MIME_SNIFFING feature control, and the FEATURE_WINDOW_RESTRICTIONS feature control.
Examples
This code snippet uses CoInternetIsFeatureEnabled to check four features of Internet Explorer, and displays a message box that states whether the features are enabled under the current process.
WCHAR wszErrMsg[MAX_BUFFER_SIZE];
StringCchCopy(wszErrMsg, ARRAYSIZE(wszErrMsg), L"Current Status of Information Bar Features:\n");
HRESULT result;
result = CoInternetIsFeatureEnabled(FEATURE_SECURITYBAND,GET_FEATURE_FROM_PROCESS);
if (result==S_OK)
StringCchCat(wszErrMsg, ARRAYSIZE(wszErrMsg), L"\tInformation Bar=On\n");
else if (result==S_FALSE)
StringCchCat(wszErrMsg, ARRAYSIZE(wszErrMsg), L"\tInformation Bar=Off\n");
else
StringCchCat(wszErrMsg, ARRAYSIZE(wszErrMsg), L"\tInformation Bar=ERROR\n");
result = CoInternetIsFeatureEnabled(FEATURE_WEBOC_POPUPMANAGEMENT,GET_FEATURE_FROM_PROCESS);
if (result==S_OK)
StringCchCat(wszErrMsg, ARRAYSIZE(wszErrMsg), L"\tPopup Management=On\n");
else if (result==S_FALSE)
StringCchCat(wszErrMsg, ARRAYSIZE(wszErrMsg), L"\tPopup Management=Off\n");
else
StringCchCat(wszErrMsg, ARRAYSIZE(wszErrMsg), L"\tPopup Management=ERROR\n");
result = CoInternetIsFeatureEnabled(FEATURE_RESTRICT_FILEDOWNLOAD,GET_FEATURE_FROM_PROCESS);
if (result==S_OK)
StringCchCat(wszErrMsg, ARRAYSIZE(wszErrMsg), L"\tFile Restriction=On\n");
else if (result==S_FALSE)
StringCchCat(wszErrMsg, ARRAYSIZE(wszErrMsg), L"\tFile Restriction=Off\n");
else
StringCchCat(wszErrMsg, ARRAYSIZE(wszErrMsg), L"\tFile Restriction=ERROR\n");
result = CoInternetIsFeatureEnabled(FEATURE_RESTRICT_ACTIVEXINSTALL,GET_FEATURE_FROM_PROCESS);
if (result==S_OK)
StringCchCat(wszErrMsg, ARRAYSIZE(wszErrMsg), L"\tActiveX Restriction=On\n");
else if (result==S_FALSE)
StringCchCat(wszErrMsg, ARRAYSIZE(wszErrMsg), L"\tActiveX Restriction=Off\n");
else
StringCchCat(wszErrMsg, ARRAYSIZE(wszErrMsg), L"\tActiveX Restriction=ERROR\n");
MessageBox(wszErrMsg, L"Information Bar Feature Status Results", MB_OK);
Requirements
|
Minimum supported client |
Windows XP with SP2 |
|---|---|
|
Minimum supported server |
Windows Server 2003 |
|
Product |
Internet Explorer 6.0 |
|
Header |
|
|
Library |
|
|
DLL |
|