title: Windows ContextMenu C++ with Shortcuts in Selection
body: <p>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. </p>
  
  <p>I've noticed this behavior in a number of 3rd party apps as well, including Notepad++, WinRar and UltraEdit. </p>
  
  <p>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).</p>
  
  <p>Edit: here is a small snippet of my current method. <code>pida-&gt;cidl</code> becomes 1 when the target is a shortcut, otherwise it is the correct number of items I've selected:</p>
  
  <pre><code>CStgMedium me; 
  pDataObj-&gt;GetData(&amp;fe, &amp;me); 
  
  LPIDA pida = reinterpret_cast&lt;LPIDA&gt;(me.hGlobal); 
  for(UINT i = 0; i &lt; pida-&gt;cidl; i++) {
      ...
  }
  </code></pre>