INamespaceWalk::Walk method

Initiates a recursive walk of the namespace from the specified root to the given depth.

Syntax


HRESULT Walk(
  [in] IUnknown         *punkToWalk,
  [in] DWORD            dwFlags,
  [inint              cDepth,
  [in] INamespaceWalkCB *pnswcb
);

Parameters

punkToWalk [in]

Type: IUnknown*

The root node from which to begin the walk. This can be represented by one of the following objects.

Specifying the desktop's IShellFolder as the root allows the possibility of walking the entire Windows namespace if cDepth is sufficiently large.

dwFlags [in]

Type: DWORD

One or more of the following flags that control the walk operation.

NSWF_DEFAULT (0x00000000)

Use this value when you do not want to set any of the other flags.

NSWF_NONE_IMPLIES_ALL (0x00000001)

Collect all of the items in the folder if both of these criteria are met:

  • punkToWalk is a folder (IShellFolder or IShellView).
  • None of the items in the folder are currently selected.

NSWF_ONE_IMPLIES_ALL (0x00000002)

Collect all of the items in the folder if both of these criteria are met:

NSWF_DONT_TRAVERSE_LINKS (0x00000004)

Do not follow links (.lnk, .url, and folder shortcuts) in the recursion; instead, return them as regular items.

NSWF_DONT_ACCUMULATE_RESULT (0x00000008)

Do not collect the PIDLs of the nodes during the namespace walk.

NSWF_TRAVERSE_STREAM_JUNCTIONS (0x00000010)

Include the contents of stream junction points in the walk. For instance, walk into the contents of a .cab file.

NSWF_FILESYSTEM_ONLY (0x00000020)

Walk only file system nodes.

NSWF_SHOW_PROGRESS (0x00000040)

Display a dialog box with a progress bar while walking the namespace.

NSWF_FLAG_VIEWORDER (0x00000080)

Return items in view order. This applies only when punkToWalk is an IShellView object.

NSWF_IGNORE_AUTOPLAY_HIDA (0x00000100)

Do not use the AutoPlay HIDA in the data object. This applies only when punkToWalk is an IDataObject object.

NSWF_ASYNC (0x00000200)

Perform the walk asynchronously by running it on a background thread.

NSWF_DONT_RESOLVE_LINKS (0x00000400)

Traverse links to return their targets (for .lnk, .url and folder shortcuts) but do not verify that those targets exist (Resolve). This is an optimization and does not affect the results except in the case where a missing or moved target could be found and returned.

NSWF_ACCUMULATE_FOLDERS (0x00000800)

NSWF_DONT_SORT (0x00001000)

Do not maintain the sort order of the items being walked.

NSWF_USE_TRANSFER_MEDIUM (0x00002000)

NSWF_DONT_TRAVERSE_STREAM_JUNCTIONS (0x00004000)

NSWF_ANY_IMPLIES_ALL (0x00008000)

Introduced in Windows 8.

cDepth [in]

Type: int

The maximum depth to descend through the namespace hierarchy. This depth is zero-based. Set to 0 to walk only the folder identified by punkToWalk but none of its subfolders.

pnswcb [in]

Type: INamespaceWalkCB*

INamespaceWalkCB callback function used by INamespaceWalk. This parameter can be NULL.

Return value

Type: HRESULT

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

Examples

For an example, see INamespaceWalk::GetIDArrayResult.

Requirements

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Shobjidl.h

IDL

Shobjidl.idl

Library

Shell32.lib

DLL

Shell32.dll (version 6.0 or later)

See also

INamespaceWalk
INamespaceWalkCB

 

 

Show: