Search code examples
vb.netwindows-shell

What are DShellFolderViewEvents and DShellFolderViewEvents_Event?


The names make it sound like some sort of event handler.
Both were identified as an interface from Shell32 using the code below: I can't find either of these in the MSDN libraries. Google returned some pages with code where they appeared, but I didn't see anything that really described the interface.

Public Sub ListTypes()
    Dim NS As String = "Shell32"
    For Each t As Type In Assembly.GetExecutingAssembly().GetTypes()
        If (t.IsClass Or t.IsInterface) And t.Namespace = NS Then
            Debug.Print(t.Name)
        End If
    Next
End Sub 

Solution

  • Based on the definition in ShlDisp.h it appears to simply be a thin wrapper around IDispatch with a different GUID.

    MIDL_INTERFACE("62112AA2-EBE4-11cf-A5FB-0020AFE7292D")
    DShellFolderViewEvents : public IDispatch
    {
    };
    

    It seems to be used in obtaining event notification from the shell - Raymond Chen's blog has some example code.