This topic has not yet been rated - Rate this topic

IFileDialog::SetFilter method

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

Applies to: desktop apps only

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

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2008

End of client support

Windows Vista

End of server support

Windows Server 2008

Header

Shobjidl.h

IDL

Shobjidl.idl

 

 

Send comments about this topic to Microsoft

Build date: 3/7/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
What we should use for Windows 7 ?
You wrote "This method is deprecated in Windows 7.", is there an alternative ?

What we exepriment under Seven is that it does not work when we change folder using de libraries shortcuts... In fact, it work sporadically so it's confusing for end user. As developper we must know the alternative and it should not work sporadically.

If there is no alternative, we must know why you drop this functionnality so we can exaplain it to our end user (and by the way our end user are also your end user).

Frédéric Hébert