掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
SHFileOperationについて (ID:26753)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
SHFileOperationをファイルのコピーに使っています。 次の2点について教えて下さい。 [1]:「上書きしますか?」のダイアログを表示しない方法 [2]:*.exe 以外の全ファイルを指定する場合のワイルドカードの記述法 uses ShellAPI, FileCtrl; procedure TForm1.Button1Click(Sender: TObject); var foStruct: TSHFileOpStruct; FromPath: string; ToPath: string; begin //コピー元のディレクトリを指定 if (SelectDirectory(FromPath, [sdAllowCreate], 0)) then begin //コピー先のディレクトリを指定 if (SelectDirectory(ToPath, [sdAllowCreate], 0)) then begin with foStruct do begin wnd := Handle; wFunc := FO_COPY; pFrom := PChar(FromPath + '\*.*' + #0); pTo := PChar(ToPath + '\' + #0); fFlags := FOF_FILESONLY or FOF_ALLOWUNDO; fAnyOperationsAborted := False; hNameMappings := nil; lpszProgressTitle := nil; end; SHFileOperation(foStruct); end; end; end;
←解決時は質問者本人がここをチェックしてください。
更新する
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.