Shell API usage

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: Hacker, petermad, Stefan2, white

Post Reply
bviksoe
Junior Member
Junior Member
Posts: 10
Joined: 2005-09-18, 14:01 UTC

Shell API usage

Post by *bviksoe »

Hi,
I'm a developer of a popular Windows Shell Namespace extension called GMail Drive. Can I give you a few hints on how I see TC call into my code? Perhaps more shell extensions would work straight out of TC.

I seems that during folder enumeration IShellFolder::GetDisplayNameOf is called with SHGDN_FORPARSING only. If a shell extension is not able to provide a valid filename all the time it may return failure. Calling again with SHGDN_NORMAL and SHGDN_INFOLDER would be appropriate to obtain the display name only.
NB: If failure is returned TC displays an invalid filename.

Double-clicking on a file causes the following sequence:
CFolder::GetDisplayNameOf (0x8000) '\filename.txt'
CFolder::GetAttributesOf #1 ''\filename.txt' 0x70C50008
I would suggest switching the calls around since this is how the FileOpen Common dialog calls into the shell. Some shell extensions are hacked to this exact sequence. If the GetDisplayNameOf call returns a valid filename here, you can just ShellExecute() it.

I'm assuming that you actually call the shell API directly in your app, and doesn't rely on SHGetFileInfo() etc.

Thank you for a fine product.

regards
bjarke
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50390
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Thanks for your suggestions about SHGDN_ options, this should be easy to add. I'm not sure whether I can influence the double-clicking thing - TC gets the IContextMenu and then calls the QueryContextMenu and InvokeCommand member functions with verb "open" to open the file...
Author of Total Commander
https://www.ghisler.com
Post Reply