0

Hello dear stackoverflow friends

A few months ago I asked you a question about QuickAccess (Pin/Unpin). Unfortunately we are still facing this issue (Unable to unpin virtual objects). After having called Microsoft Support a few times, they replied us we should subscribe to premier support... Too expensive for a small company.

So we have decided to Mimic the Windows 7 Favorites in our Shell Namespace Extension.

No big deal in the Explorer, calling ShellExecuteEx with view's handle and lnk's target object absolute pidl works like a charm.

Too good to be true, yeah, as it is not working as expected in IFileDialogs... First the lnks (wrapped in a virtual object, but parsing name is Filesystem Path) weren't for obvious reasons shown in the dialogs. So we tried with attributes such as "SFGAO_FOLDER", "SFGAO_FILESYSANCESTOR" etc. but then the shell was calling IShellFolder's EnumObjects and that's not what we want.

So we decided to have a go with the Interface IObjectWithSite, implementing it in our Favorites' folder. We were then able to consume events from IFileDialogs such as OnSelectionChange. Then we tried the same method as in the explorer, getting view handle (first querying IOleWindow interface, getting window handle, creating view in parent IShellFolder using window handle) and calling ShellExecuteEx... And the result is.. A big application (Notepad, Word etc.) crash and a new Explorer Window with the right virtual object selected.

Probably is my approach too complicated, have you got any ideas?

Thanks a lot!

gouigoui
  • 48
  • 8
  • Sorry, I'm still on the first question but what do you mean by "Unable to pin virtual objects". To unpin a folder from Quick Access (virtual or not), you can just right click on this folder (from the Quick Access parent folder, not from the folder itself) and select 'Unpin from quick access'. Or what are you trying to achieve? – Simon Mourier Oct 30 '18 at 19:00
  • Yeah unfortunately the 'unpin from quick access' doesn't show off when I'm right clicking on a pinned virtual object... That's the issue. – gouigoui Oct 30 '18 at 22:29
  • Also, since the display name for parsing is a filesystem path, the virtual objects are very often replaced by their filesystem counterparts. – gouigoui Oct 30 '18 at 22:33
  • Just to make sure, the 'unpin from quick access' doesn't show when you right-click on the pinned virtual item in the Quick Access folder, or in your namespace extension? – Simon Mourier Oct 31 '18 at 07:51
  • on the pinned virtual item in the Quick Access folder – gouigoui Oct 31 '18 at 09:31
  • https://i.stack.imgur.com/OjlEm.png – gouigoui Oct 31 '18 at 10:01
  • 1
    It should work w/o any specific effort: https://i.imgur.com/VVMhAIw.png – Simon Mourier Oct 31 '18 at 13:50
  • Ok maybe I should have a look at the QueryContextMenu implementation... – gouigoui Oct 31 '18 at 14:37
  • Ok, we had the same approach as you do with ShellBoost, but now we have stacked quite a lot of functionalities from IoC to "hybrid connectors" on top of that... probably some dead bodies are lying around. – gouigoui Oct 31 '18 at 15:00
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/182881/discussion-between-gouigoui-and-simon-mourier). – gouigoui Oct 31 '18 at 16:12

1 Answers1

0

Thank to Simon, I was able to find a solution, still work in progress. The issue is that the IContextMenu, IContextMenu2 and also IContextMenu3 interfaces are implemented in the solution. On Windows 7, the .lnk menu handler was called, fine, on Windows 10 on the other hand you need to call SHCreateDefaultContextMenu, then merging the menu handlers (SHCreateDefaultContextMenu will then Call IShellFolder::GetUIObjectOf with IID_IQueryAssociations). So the code was dated... Thanks!

gouigoui
  • 48
  • 8