我想控制savedialog的filename设为不能改动,该怎么做!谢了

解决方案 »

  1.   

    直接弹出浏览矿。。只显示路径然后 copyfile()就ok了
      

  2.   

    看看SaveDialog是怎么实现的。拦API咯
      

  3.   

    procedure TForm7.Button1Click(Sender: TObject);
    var
      bi: TBrowseInfo;
      pidl: pItemIdList;
      strpath, displayname: string;
    begin
      SetLength (displayname, 100);
      bi.hwndOwner := Handle;
      bi.pidlRoot := nil;
      bi.pszDisplayName := pChar (displayname);
      bi.lpszTitle := '选择备份文件夹';
      bi.ulFlags := bif_StatusText;
      bi.lpfn := nil;
      bi.lParam := 0;
      pidl := ShBrowseForFolder (bi);
      SetLength (strPath, 100);
      ShGetPathFromIdList (pidl, PChar(strPath));
      edit1.Text := strPath;
     end;
    用这个。然后copyfile