IFileDialog::SetFilter method (shobjidl_core.h)

[Deprecated. SetFilter is no longer available for use as of Windows 7.]

Sets the filter.

Syntax

HRESULT SetFilter(
  IShellItemFilter *pFilter
);

Parameters

pFilter

Type: IShellItemFilter*

A pointer to the IShellItemFilter that is to be set.

Return value

Type: HRESULT

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

This method can be used if the application needs to perform special filtering to remove some items from the dialog box's view. IncludeItem will be called for each item that would normally be included in the view. GetEnumFlagsForItem is not used. To filter by file type, IFileDialog::SetFileTypes should be used, because in folders with a large number of items it may offer better performance than applying an IShellItemFilter.

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header shobjidl_core.h (include Shobjidl.h)