2

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.

nico
  • 127
  • 1
  • 13
  • 1
    No way. Preview handlers can be associated only with files. – Denis Anisimov May 18 '16 at 09:20
  • @DenisAnisimov: A Preview Handler is registered with a ProgID, and the `Folder` ProgID has a `shellex` subkey for registering shell extensions for folders. I registered a *file* preview handler (for `.doc` files) to the `Folder` ProgID and Windows Explorer immediately started pausing for a few seconds when I clicked on a folder with the Preview pane open, and the preview was blank instead of showing "No preview available". Then I removed the handler and the pause disappeared and the preview showed "No preview available" again. So clearly Windows Explorer *can* display previews for folders. – Remy Lebeau May 18 '16 at 18:25

1 Answers1

3

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.

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
  • It sounds good. I just need to find out how to implement COM object on Lazarus. Thanks – nico May 19 '16 at 06:41