[英]CoInternetIsFeatureEnabled in Delphi2010
I am trying to deactivate the annoying sound when clicking a link in WebBrowser control, WITHOUT changing the user registry. 我试图在单击WebBrowser控件中的链接时停用烦人的声音,而无需更改用户注册表。 I've found documentation that this can be done through CoInternetIsFeatureEnabled , also explained here .
我发现可以通过CoInternetIsFeatureEnabled完成此操作的文档, 在此处也进行了说明。 But i have no idea how to implement it on Delphi 2010, since i am getting "Undeclared Identifier" error after including URLMon unit into the project and not much documentation out there.
但是我不知道如何在Delphi 2010上实现它,因为在项目中包含URLMon单元并且在那里没有太多文档后,出现“未声明的标识符”错误。
Any ideas? 有任何想法吗?
CoInternetIsFeatureEnabled()
and CoInternetSetFeatureEnabled()
are not included in D2010's copy of UrlMon.pas. CoInternetIsFeatureEnabled()
和CoInternetSetFeatureEnabled()
不包含在D2010的UrlMon.pas副本中。 You will have to declare them manually, eg: 您将必须手动声明它们,例如:
const
GET_FEATURE_FROM_THREAD = $00000001;
GET_FEATURE_FROM_PROCESS = $00000002;
GET_FEATURE_FROM_REGISTRY = $00000004;
GET_FEATURE_FROM_THREAD_LOCALMACHINE = $00000008;
GET_FEATURE_FROM_THREAD_INTRANET = $00000010;
GET_FEATURE_FROM_THREAD_TRUSTED = $00000020;
GET_FEATURE_FROM_THREAD_INTERNET = $00000040;
GET_FEATURE_FROM_THREAD_RESTRICTED = $00000080;
SET_FEATURE_ON_THREAD = $00000001;
SET_FEATURE_ON_PROCESS = $00000002;
SET_FEATURE_IN_REGISTRY = $00000004;
SET_FEATURE_ON_THREAD_LOCALMACHINE = $00000008;
SET_FEATURE_ON_THREAD_INTRANET = $00000010;
SET_FEATURE_ON_THREAD_TRUSTED = $00000020;
SET_FEATURE_ON_THREAD_INTERNET = $00000040;
SET_FEATURE_ON_THREAD_RESTRICTED = $00000080;
type
INTERNETFEATURELIST = (
FEATURE_OBJECT_CACHING,
FEATURE_ZONE_ELEVATION,
FEATURE_MIME_HANDLING,
FEATURE_MIME_SNIFFING,
FEATURE_WINDOW_RESTRICTIONS,
FEATURE_WEBOC_POPUPMANAGEMENT,
FEATURE_BEHAVIORS,
FEATURE_DISABLE_MK_PROTOCOL,
FEATURE_LOCALMACHINE_LOCKDOWN,
FEATURE_SECURITYBAND,
FEATURE_RESTRICT_ACTIVEXINSTALL,
FEATURE_VALIDATE_NAVIGATE_URL,
FEATURE_RESTRICT_FILEDOWNLOAD,
FEATURE_ADDON_MANAGEMENT,
FEATURE_PROTOCOL_LOCKDOWN,
FEATURE_HTTP_USERNAME_PASSWORD_DISABLE,
FEATURE_SAFE_BINDTOOBJECT,
FEATURE_UNC_SAVEDFILECHECK,
FEATURE_GET_URL_DOM_FILEPATH_UNENCODED,
FEATURE_TABBED_BROWSING,
FEATURE_SSLUX,
FEATURE_DISABLE_NAVIGATION_SOUNDS,
FEATURE_DISABLE_LEGACY_COMPRESSION,
FEATURE_FORCE_ADDR_AND_STATUS,
FEATURE_XMLHTTP,
FEATURE_DISABLE_TELNET_PROTOCOL,
FEATURE_FEEDS,
FEATURE_BLOCK_INPUT_PROMPTS,
FEATURE_ENTRY_COUNT
);
function CoInternetIsFeatureEnabled(FeatureEntry: INTERNETFEATURELIST; dwFlags: DWORD): HRESULT; stdcall; external 'urlmon.dll'
function CoInternetSetFeatureEnabled(FeatureEntry: INTERNETFEATURELIST; dwFlags: DWORD; fEnable: BOOL): HRESULT; stdcall; external 'urlmon.dll'
begin
if CoInternetIsFeatureEnabled(FEATURE_DISABLE_NAVIGATION_SOUNDS, GET_FEATURE_FROM_PROCESS) = S_FALSE then
CoInternetSetFeatureEnabled(FEATURE_DISABLE_NAVIGATION_SOUNDS, SET_FEATURE_ON_PROCESS, True);
end;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.