I'm having difficulty obtaining the list of selected files in my implementation of a ContextMenu when the target of my right-click is a shortcut. The global memory handle returns a list containing only the shortcut item, and doesn't seem to know about any of the other items I've selected.
I've noticed this behavior in a number of 3rd party apps as well, including Notepad++, WinRar and UltraEdit.
What is the correct way to obtain a list of selected files when the target of the right-click is a shortcut? This isn't an issue for the file compression functionality baked into Explorer (right click > send to > compressed zipped folder).
Edit: here is a small snippet of my current method. pida->cidl
becomes 1 when the target is a shortcut, otherwise it is the correct number of items I've selected:
CStgMedium me;
pDataObj->GetData(&fe, &me);
LPIDA pida = reinterpret_cast<LPIDA>(me.hGlobal);
for(UINT i = 0; i < pida->cidl; i++) {
...
}