Click here to Skip to main content
15,891,633 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

Has anyone managed to pass custom preview image to Vista style dialog? I succeded to force preview pane visible always in opened FileDialog, also I could get selected file path in the files list passing my own IFileDialogEvents handlers (big thank you to Michael Dunn for his article[^]) but cannot find solution how to pass picture to preview pane.

Thanks in advance
marukas
Posted

Customizing Win7 Open File Dialog with IFileDialogCustomize, IFileDialogEvents and IFileDialogControlEvents is one thing.
Customizing Shell Namespace - the data on background you browse with the dialog (and also with Windows Explorer), including their preview, is another story...

IPreviewHandler allows you to define the preview and FileOpenDialog will show it because it finally will call it...
But IPreviewHandler implementation is not registered to FileOpenDialog - it is a Shell Namespace interface (... welcome to hell :)).
See:
http://msdn.microsoft.com/en-us/library/bb776867(v=vs.85).aspx
http://msdn.microsoft.com/en-us/library/bb266530(v=vs.85).aspx

The similar is valid for Shell Namespace Extensions you can define to enrich content of the browsed tree of Shell Items (folders, files, printers etc.) with your own subtree of your own items...
Here there is also no chance to ask File Dialog directly to alter content of the the tree.


However, I am afraid there is NO WAY to define specific preview only for a file in your instance of File Dialog.
I would suggest to add button with :My very special preview: opening a dialog with your special preview that eventually would respond to selection change triggered in IFileDialogEvents. I know it is not a real solution and am sorry I have to say I cannot find any better...
 
Share this answer
 
Seems like quite the curly problem. You're way, way ahead of me on this topic.
I don't suppose that either of these interfaces have escaped your attention?

IPreviewHandler Interface
IPreviewItem Interface
 
Share this answer
 
Comments
marukas31 30-Jun-11 9:11am    
Well, I think IPreviewHandler should solve the problem but I cannot find how to pass it to the IFileDialog while IFileDialog->Advice accepts IFileDialogEvents interface and even if I put IPreviewHandler into event handler map:

BEGIN_COM_MAP(CDlgEventHandler)
COM_INTERFACE_ENTRY(IFileDialogEvents)
COM_INTERFACE_ENTRY(IPreviewHandler)
END_COM_MAP()

and override its functions I do not get any calls to them :(

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900