Search code examples
delphiwindows-7systemwindows-explorerpreview-pane

Modify windows 7 preview pane to display a folder's subdirectories instead of a big empty frame


I would like to get rid of an extremely annoying windows7 behaviour and i think there are no other way than overriding windows programatically.

Since i'm confortable with delphi and it can also do a lot in system programming i am thinking of using this language, but let's explain first :

In windows 7 file explorer there is the preview pane ( usually located in the right side of any explorer's window ) that show you the content of the current selected file if supported ( office files, pictures, html and text based files ).

Example :

Usefull preview pane

But an annoying behaviour of this panel is that when you select a folder, the pane remains completely empty :

Empty preview pane

I would like it to display the content of the selectd folder ( files and folders icon and name ) so that there is no need to open it.

To do that i think i have to deal with windows dll. I know i will have to search more deeply about that but i would like some experienced user to tell me if it is definitely not possible, or if possible where to start investigating or how to proceed. Also any other advice is welcome.

If i mange to do that i would be glad to share it over internet.


Solution

  • Create a custom Preview Handler COM object and register it for the HKEY_CLASSES_ROOT\Folder ProgID in the Registry:

    HKEY_CLASSES_ROOT\Folder\shellex\{8895b1c6-b41f-4c1c-a562-0d564250836f}
    (Default) = [REG_SZ] "your CLSID here"
    

    Your handler should implement IInitializeWithFile or IInitializeWithItem, and not IInitializeWithStream, so it can receive the path/IShellItem of a selected folder. Then you can enumerate that folder's content and display it in your implemented IPreviewHandler UI as needed.