4

When I right click on a file in windows explorer I get the filename of this file for all files but .lnk files.
How can I get the fileanme of the .lnk file and not the filename pointed by the shortcut ?

I use this C++ code :

  #pragma region IShellExtInit

  // Initialize the context menu handler.
  IFACEMETHODIMP FileContextMenuExt::Initialize(
      LPCITEMIDLIST pidlFolder, LPDATAOBJECT pDataObj, HKEY hKeyProgID)
  {
    if (NULL == pDataObj)
    {
        return E_INVALIDARG;
    }


    HRESULT hr = E_FAIL;

    FORMATETC fe = { CF_HDROP, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
    STGMEDIUM stm;

    // The pDataObj pointer contains the objects being acted upon. In this 
    // example, we get an HDROP handle for enumerating the selected files and 
    // folders.
    if (SUCCEEDED(pDataObj->GetData(&fe, &stm)))
    {

Thank you.

4

0 回答 0