GetUIObjectOf
(1)
CoCreateInstance
(1)
IPreviewHandler
(1)
IShellBrowser
(1)
IShellFolder
(1)
BindToObject
(1)
IShellView
(1)
ProgID
(1)

NSE shall call intalled Preview Handlers

Asked By Kai-Uwe
07-Jan-10 11:22 AM
Hi folks,

we have writen an NSE implementing a virtual file system. Now we want to use
the Preview Handler. where do we have to start? as far as i read, we need to
implement IShellFolder::GetUIObjectOf for (riid == IID_PreviewHandler)
and
IShellFolder::BindToObject for riid == IID_Stream.

our NSE aint getting called by any of those IID's. Any hint what we are
making wrong ?


thanks alot Kai-Uwe

This should get you started:http://msdn.microsoft.com/en-us/magazine/cc163487.

bviksoe replied to Kai-Uwe
08-Jan-10 06:53 AM
This should get you started:
http://msdn.microsoft.com/en-us/magazine/cc163487.aspx

I believe that you got it correct so far, but you will need to register
the extension properly, with
ShellEx\{8895B1C6-B41F-4C1C-A562-0D564250836F} under your NSE
and also
HKLM\...\Microsoft\CurrentVersion\PreviewHandlers for public
registration
This is explained in the MSDN article.

Also when you get GetUIObjectOf queried for IQueryAssociations, make
sure to include your NSE clsid as an ASSOCCLASS_CLSID_STR entry, so
the Shell knows to use your ShellEx registry stuff.

bjarke

Hehe, its you, digging just in this moment through your great Flickr'Stuff

Kai-Uwe replied to bviksoe
08-Jan-10 06:40 AM
Hehe, its you, digging just in this moment through your great Flickr'Stuff ;-)

I guess i have a mayor misunderstanding about PreView's. What i want to do
is to show all those office docs and TXT files we have in our virtual
filesystem (namespace extention) So far we dont have any own items which
would need an own preview handler. I want to pass the *.Doc stream to the
Preview Pane in the explorer.

we have our own IShellView implementation with a LVN_ITEMACTIVATE.

maybe atm i just need to know how to get the hwnd of the Preview Pane?

or do we need really get further into the registry stuff or do we need to
implement our own preview handler for our own NSE ?

I did not attempt to enable previews for the FlickrDrive stuff I made,but I

bviksoe replied to Kai-Uwe
08-Jan-10 05:44 PM
I did not attempt to enable previews for the FlickrDrive stuff I made,
but I figured IQueryAssociations would be the key to unlock it. By
spawning a IQueryAssociations on requests that includes the file-
extension (ProgID?) association element, that should enable the
preview. I did not try this because I am not really sure how much else
(other handlers) this will bring in - especially I did not want context
menus directly from the specific file-extensions to appear as they
might assume my virtual filesystem was able to hand them a real
filepath in all cases. The Preview handler is fed with the IStream
data so that is a really good thing - but ultimately you may need to
write a custom IQueryAssociations implementation that specifically
serves {8895B1C6-B41F-4C1C-A562-0D564250836F} from the filename
extension, and the rest from your standard associations.

bjarke
CodeProject has a sample about a vista preview app.
Kai-Uwe replied to bviksoe
08-Jan-10 09:16 AM
CodeProject has a sample about a vista preview app. There is a work around
for the IQueryAssociations. by that you get the CLSID for
CoCreateInstance(cls,... IID_IPreviewHandler,...)

I guess all i need now is the hwnd and rectPreview for
IPreviewHandler::SetWindow().

i looked at IShellBrowser and IShellView, but wasnt able to figure out how
to get those 2 parameters.

Anyone out there who can point me to the way how to get the hWnd ?
Post Question To EggHeadCafe