I'm building a kind of dock, and I struggle at finding how to save things like "Run", "Search", "Help", "Printers" and reopen them after that.
I tried this :
CComPtr<IShellFolder> pDF;
SHGetDesktopFolder(&pDF);
LPITEMIDLIST pidlPrintersAndFaxes=0;
hr=pDF->ParseDisplayName(0, 0, L"::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}\\::{2227A280-3AEA-1069-A2DE-08002B30309D}", 0, &pidlPrintersAndFaxes, NULL);
CComPtr<IShellFolder> pSF;
hr=pDF->BindToObject(pidlPrintersAndFaxes, 0, IID_IShellFolder, (void**)&pSF);
LPITEMIDLIST pidlPrinter=0;
hr=pSF->ParseDisplayName(0, 0, L"PDFCreator", 0, &pidlPrinter, NULL);
CComPtr<IContextMenu> pPrinterCtxMenu;
hr=pSF->GetUIObjectOf(0, 1, (LPCITEMIDLIST*)&pidlPrinter, IID_IContextMenu, 0, (void**)&pPrinterCtxMenu);
CMINVOKECOMMANDINFO cmd={0};
cmd.cbSize=sizeof(CMINVOKECOMMANDINFO);
cmd.lpVerb=MAKEINTRESOURCE(0);
cmd.nShow=SW_SHOWNORMAL;
hr=pPrinterCtxMenu->InvokeCommand(&cmd);
Whatever I try InvokeCommand on the last line always return E_INVALIDARG. I tried it with ShellExecuteEx and got the same error.
I tried every possible verbs.
I tried to enumerate the verbs and got E_INVALIDARG.
I can't make it work but on normal filesystem path like "c:\" and clsid on folders. What did I miss ?