IAttachmentExecute::CheckPolicy method (shobjidl_core.h)

Provides a Boolean test that can be used to make decisions based on the attachment's execution policy.


HRESULT CheckPolicy();

Return value


Returns one of the following values.

Value Meaning
S_OK Enable
S_FALSE Prompt
Any other failure code Disable


IAttachmentExecute::CheckPolicy examines a set of properties known collectively as evidence. Anything used to determine trust level is considered evidence. These properties are set using the following methods.

The information returned by IAttachmentExecute::CheckPolicy enables an application to modify its UI appropriately for the situation.

IAttachmentExecute::CheckPolicy requires the application first to call either IAttachmentExecute::SetFileName or IAttachmentExecute::SetLocalPath.


Minimum supported client Windows XP with SP2 [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header shobjidl_core.h (include Shobjidl.h)
DLL Shdocvw.dll (version 6.0 or later)