手头现有一个播放器, archos404,以windows media device mode 连在电脑上,
在“我的电脑”里面显示一个播放器的图标, 右键->Explorer ,可以用windows的资源管理器打开播放器里面的层层目录,就像普通u盘
地址栏是诸如  My Computer\a404\Internal HardDisk\Data 这样的目录地址
问题: 如何在程序里面, 用api调用资源管理器打开这样的目录,
shellexecute加My Computer\a404\Internal HardDisk\Data, 这样的参数好像不行非常感谢 !!

解决方案 »

  1.   

    ShellExecute(NULL, "open", "D:\\My Computer\\a404\\Internal HardDisk\\Data", NULL, NULL, SW_SHOWNORMAL);
      

  2.   

    感谢楼上,可是 LPITEMIDLIST  pidl;
    LPCITEMIDLIST cpidl;
    LPSHELLFOLDER pDesktopFolder;
    char          szPath[MAX_PATH];
    OLECHAR       olePath[MAX_PATH];
    ULONG         chEaten;
    HRESULT       hr;

    sprintf(szPath, "My Computer\\a404\\Internal HardDisk\\Albums");
    // 
    // Get a pointer to the Desktop's IShellFolder interface.
    // 
    if (SUCCEEDED(SHGetDesktopFolder(&pDesktopFolder)))
    {
    // 
    // IShellFolder::ParseDisplayName requires the file name be in
    // Unicode.
    // 
    MultiByteToWideChar(CP_ACP, MB_COMPOSITE, szPath, -1,
    olePath, MAX_PATH);

    // 
    // Convert the path to an ITEMIDLIST.
    // 
    hr = pDesktopFolder->ParseDisplayName(NULL,0,olePath,&chEaten,&pidl,&dwAttributes);
    if (FAILED(hr)) E_OUTOFMEMORY
    {
    AfxMessageBox("ERROR");
    // Handle error.
    }
    cpidl = pidl;
    HRESULT RE = CoInitialize(NULL);
    int re = SHOpenFolderAndSelectItems(cpidl,1,&cpidl,NULL);
    pDesktopFolder->Release();
    }  ParseDisplayName fail了