解决方案 »

  1.   

    function GetQuickLaunchPath : string;
    const
       AppDir='\Microsoft\Internet Explorer\Quick Launch';
    begin
     Result := '';
    With TRegistry.Create do
      begin
        RootKey := HKEY_CURRENT_USER;
        if OpenKey(REGSTR_PATH_SPECIAL_FOLDERS,FALSE) then
        begin
          Result := ReadString('AppData');
          CloseKey;
        end;
        Free;
       Result := Result+Appdir;
      end;
    end;
      

  2.   

    应该是如下,你改为Delphi代码就行了AnsiString __fastcall TMainForm::GetQuickLPath()
    {
      AnsiString S,KeyName;
      DWORD dwVersion;
      TRegistry *Registry = new TRegistry;  dwVersion = GetVersion();  if (dwVersion < 0x80000000)   // Windows NT  dwBuild = (DWORD)(HIWORD(dwVersion));
         {
          KeyName="Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders";
          Registry->RootKey = HKEY_CURRENT_USER ;//2000
          }
      else
         {
          KeyName=".DEFAULT\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders";
          Registry->RootKey = HKEY_USERS; //98
          }  try
      {
        if(Registry->OpenKey(KeyName,false))
            {
             Registry->OpenKey(KeyName,false);
             S = Registry->ReadString("AppData");
             }
      }
      __finally
      {
        delete Registry;
      }  return S+"\\Microsoft\\Internet Explorer\\Quick Launch";
    }
      

  3.   

    利用API函数 SHGetSpecialFolderLocation(
        HWND hwndOwner, 
        int nFolder, 
        LPITEMIDLIST *ppidl
       );