IFileDialogEvents::OnFolderChanging method (shobjidl_core.h)

Called before IFileDialogEvents::OnFolderChange. This allows the implementer to stop navigation to a particular location.

Syntax

HRESULT OnFolderChanging(
  [in] IFileDialog *pfd,
  [in] IShellItem  *psiFolder
);

Parameters

[in] pfd

Type: IFileDialog*

A pointer to the interface that represents the dialog.

[in] psiFolder

Type: IShellItem*

A pointer to an interface that represents the folder to which the dialog is about to navigate.

Return value

Type: HRESULT

Returns S_OK if successful, or an error value otherwise. A return value of S_OK or E_NOTIMPL indicates that the folder change can proceed.

Remarks

The calling application can call IFileDialog::SetFolder during this callback to redirect navigation to an alternate folder. The actual navigation does not occur until IFileDialogEvents::OnFolderChanging has returned.

If the calling application simply prevents navigation to a particular folder, UI should be displayed with an explanation of the restriction. To obtain a parent HWND for the UI, obtain the IOleWindow interface through IFileDialog and call IOleWindow::GetWindow.

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)