Click here to Skip to main content
15,893,588 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: determine sigma size of Gaussian mask Pin
CPallini21-Feb-08 21:20
mveCPallini21-Feb-08 21:20 
GeneralRe: determine sigma size of Gaussian mask Pin
gentleguy21-Feb-08 22:51
gentleguy21-Feb-08 22:51 
QuestionSend data to a service Pin
nitin321-Feb-08 20:03
nitin321-Feb-08 20:03 
GeneralRe: Send data to a service Pin
Matthew Faithfull21-Feb-08 22:35
Matthew Faithfull21-Feb-08 22:35 
AnswerRe: Send data to a service Pin
Rajkumar R21-Feb-08 22:51
Rajkumar R21-Feb-08 22:51 
GeneralRe: Send data to a service Pin
Maxwell Chen21-Feb-08 23:00
Maxwell Chen21-Feb-08 23:00 
GeneralRe: Send data to a service Pin
Rajkumar R22-Feb-08 2:47
Rajkumar R22-Feb-08 2:47 
Generallnk file path [modified] Pin
john563221-Feb-08 19:35
john563221-Feb-08 19:35 
Third time I am posting the same question but nobody answrered it. Is this tricky question or anything else.

I have written a ContextMenuHandler in VC++, creating a Right-Click for all files (*) and all works really well except that it does not handle .lnk files.
With .lnk files I can only get the target file (eg an exe file) .

Can anyone tell me how to get the .lnk file path?

My code to retrieve the file name is as follows:

<br />
void CCoMenHandler::GetSelectedFiles(LPCITEMIDLIST pidlFolder,IDataObject *pdtobj)<br />
<br />
{<br />
<br />
// get these paths into a CStringArray<br />
   g_szSelectedFiles.RemoveAll();<br />
 <br />
   // fetch all of the file names we're supposed to operate on<br />
   if (pdtobj) <br />
   {<br />
    pdtobj->AddRef();<br />
<br />
    STGMEDIUM medium;<br />
    FORMATETC fe = { CF_HDROP, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL};<br />
<br />
    HRESULT hr = pdtobj->GetData (&fe, &medium);<br />
    if (FAILED (hr))<br />
    {<br />
     g_bRecyleBin=TRUE;<br />
     GetRecycleBinFiles();//I could not detect the name of RecycleBin Folder on right click<br />
     return ;<br />
    }<br />
    g_bRecyleBin=FALSE;<br />
    // buffer to receive filenames<br />
    char path[MAX_PATH];<br />
<br />
     // how many are there?<br />
    UINT fileCount = DragQueryFile((HDROP)medium.hGlobal, 0xFFFFFFFF,<br />
    path, MAX_PATH);<br />
<br />
    if (fileCount>0)<br />
    {<br />
     // avoid wasting mem when this thing gets filled in<br />
     g_szSelectedFiles.SetSize(fileCount);<br />
<br />
     // stash the paths in our CStringArray<br />
     for (UINT i=0;i<fileCount;i++) <br />
         {<br />
      // clear old path<br />
      memset(path, 0, MAX_PATH);<br />
      // fetch new path<br />
      if (DragQueryFile((HDROP)medium.lpszFileName, i, path, MAX_PATH)) <br />
            {<br />
            g_szSelectedFiles.SetAt(i, path);<br />
    //AfxMessageBox(path);<br />
        }<br />
       }<br />
<br />
         g_szSelectedFiles.FreeExtra();<br />
      }<br />
<br />
      // free our path memory - we have the info in our CStringArray<br />
      ReleaseStgMedium(&medium);<br />
   }<br />
<br />
}<br />
<br />
<br />
<br />


modified on Friday, February 22, 2008 6:44 AM

GeneralRe: lnk file path Pin
Iain Clarke, Warrior Programmer22-Feb-08 5:07
Iain Clarke, Warrior Programmer22-Feb-08 5:07 
QuestionC++ package objects into separate .dll class library projects Pin
TheGeneral6921-Feb-08 18:40
TheGeneral6921-Feb-08 18:40 
AnswerRe: C++ package objects into separate .dll class library projects Pin
Rajkumar R21-Feb-08 19:15
Rajkumar R21-Feb-08 19:15 
GeneralRe: C++ package objects into separate .dll class library projects Pin
TheGeneral6921-Feb-08 20:40
TheGeneral6921-Feb-08 20:40 
GeneralRe: C++ package objects into separate .dll class library projects Pin
TheGeneral6925-Feb-08 14:50
TheGeneral6925-Feb-08 14:50 
AnswerRe: C++ package objects into separate .dll class library projects Pin
Rajkumar R25-Feb-08 16:56
Rajkumar R25-Feb-08 16:56 
GeneralRe: C++ package objects into separate .dll class library projects Pin
TheGeneral6925-Feb-08 19:12
TheGeneral6925-Feb-08 19:12 
GeneralAbout constructer Pin
rowdy_vc++21-Feb-08 17:46
rowdy_vc++21-Feb-08 17:46 
AnswerRe: About constructer [modified] Pin
Rajkumar R21-Feb-08 18:31
Rajkumar R21-Feb-08 18:31 
QuestionRe: About constructer Pin
CPallini21-Feb-08 21:23
mveCPallini21-Feb-08 21:23 
GeneralRe: About constructer Pin
Hamid_RT23-Feb-08 1:54
Hamid_RT23-Feb-08 1:54 
GeneralRe: About constructer Pin
David Crow22-Feb-08 2:41
David Crow22-Feb-08 2:41 
GeneralNooby would like assistance with compile error building a property sheets program [modified] Pin
doorprize21-Feb-08 17:06
doorprize21-Feb-08 17:06 
GeneralRe: Nooby would like assistance with compile error building a property sheets program Pin
Rajkumar R21-Feb-08 18:23
Rajkumar R21-Feb-08 18:23 
GeneralRe: Nooby would like assistance with compile error building a property sheets program Pin
David Crow22-Feb-08 2:43
David Crow22-Feb-08 2:43 
GeneralSystemtray Pin
act_x21-Feb-08 15:04
act_x21-Feb-08 15:04 
GeneralRe: Systemtray Pin
Stephen Hewitt21-Feb-08 16:06
Stephen Hewitt21-Feb-08 16:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.