在delphi中 有没有什么方法或控件可以获取在开始菜单中程序下最后一个项的文件名? 如题.

解决方案 »

  1.   


    现在就是这个问题了
    就是在这个文件夹中获取最新建立的文件夹名称C:\Documents and Settings\Administrator\「开始」菜单\程序 各位有什么办法吗?
      

  2.   

    C:\Documents and Settings\Administrator\「开始」菜单\程序 
    仅考虑这个路径应该不够吧
    还要考虑C:\Documents and Settings\All Users\「开始」菜单\程序
      

  3.   

    我只需要当前登录用户下,其他的不用考虑。 最主要的是我要获取文件夹名字而已。 API函数不慎了解。故。各位。摆脱了。
      

  4.   

    Crazy Crazy Crazy Crazy Crazy Crazy 
      

  5.   


      procedure   TForm1.Button1Click(Sender:   TObject);   
      var   
          vSearchRec:   TSearchRec;   
          LocalFileTime:   TFileTime;   
          I:   Integer;   
      begin   
          if   FindFirst('autoexec.bat',   faAnyFile,   vSearchRec)   =   0   then   
        
          FileTimeToLocalFileTime(vSearchRec.FindData.ftCreationTime,   LocalFileTime);   
          FileTimeToDosDateTime(LocalFileTime,   LongRec(I).Hi,   LongRec(I).Lo);   
          Memo1.Lines.Values['创建时间']   :=   DateTimeToStr(FileDateToDateTime(I));      
      end;   
      

  6.   


    function MakeFileList(Path,FileExt:string):TStringList ;
    var
    sch:TSearchrec;
    begin
    Result:=TStringlist.Create;if rightStr(trim(Path), 1) <> '\' then
        Path := trim(Path) + '\'
    else
        Path := trim(Path);if not DirectoryExists(Path) then
    begin
        Result.Clear;
        exit;
    end;if FindFirst(Path + '*', faAnyfile, sch) = 0 then
    begin
        repeat
           Application.ProcessMessages;
           if ((sch.Name = '.') or (sch.Name = '..')) then Continue;
           if DirectoryExists(Path+sch.Name) then
           begin
             Result.AddStrings(MakeFileList(Path+sch.Name,FileExt));
           end
           else
           begin
             if (UpperCase(extractfileext(Path+sch.Name)) = UpperCase(FileExt)) or (FileExt='.*') then
             Result.Add(Path+sch.Name);
           end;
        until FindNext(sch) <> 0;
        SysUtils.FindClose(sch);
    end;
    end;