How to get embedded Explorer IShellView to be browsable (i.e. trigger BrowseObject event) How to get embedded Explorer IShellView to be browsable (i.e. trigger BrowseObject event) windows windows

How to get embedded Explorer IShellView to be browsable (i.e. trigger BrowseObject event)


On Vista or higher you can switch to hosting ExplorerBrowser, from which you can QI IObjectWithSite and pass an object that implements IServiceProvier with services like SID_SShellBrowser or SID_SInPlaceBrowser.

On XP you probably need to handle DDE messages originated from your process as the default folder association is DDE back then.


Some missing code I used to reproduce this example.

TForm1 = class(TForm, IShellBrowser)

After that implement the IShellBrowser interface and get the FShellBrowser variable.

self.GetInterface(IID_IShellBrowser, FShellBrowser)

use FShellBrowser in:

FShellView.CreateViewWindow(FPreviousView, FFolderSettings, FShellBrowser, FHostRect, FViewHandle)

Clicking a directory only generates:

OnViewWindowActiveGetControlWindow

Another problem with this code is:How to communicate to Explorer that the form is resized and you want to resize the hosted Explorer. Explorer browser has the SetRect method.

I agree use IExplorerBrowser.