【delphi开源代码栏目提醒】:网学会员--在 delphi开源代码编辑为广大网友搜集整理了:Frm_Delete.pas绩等信息,祝愿广大网友取得需要的信息,参考学习。
unit Frm_Delete;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, FileCtrl,shellAPI, XPMan, ComCtrls;
type
TFrmDeleteFile = class(TForm)
GBxFileList: TGroupBox;
DriveComboBox1: TDriveComboBox;
DirectoryListBox1: TDirectoryListBox;
FileListBox: TFileListBox;
Btndelete: TButton;
BtnClose: TButton;
XPManifest1: TXPManifest;
procedure BtndeleteClick(Sender: TObject);
procedure BtnCloseClick(Sender: TObject);
private
procedure DeleFile(Const DFile:string);
{ Private declarations }
public
{ Public declarations }
end;
var
FrmDeleteFile: TFrmDeleteFile;
implementation
{$R *.dfm}
procedure TFrmDeleteFile.DeleFile(Const DFile:string);
var
SHFile:SHFILEOPSTRUCT;
begin
with Shfile do
begin
Wnd:=0;
wFunc:=FO_DELETE ;
pFrom:=Pchar(DFile);
fFlags:=FOF_ALLOWUNDO;
lpszProgressTitle:='将文件删除到回收站!';
end;
SHFileOperation(ShFile);
end;
procedure TFrmDeleteFile.BtndeleteClick(Sender: TObject);
begin
delefile(FileListbox.FileName);
FileListbox.Update;
end;
procedure TFrmDeleteFile.BtnCloseClick(Sender: TObject);
begin
Close;
end;
end.