海信家电”换帅 “ 高玉玲接替代慧忠出任新任董事长
2024-11-22
图1 主界面 |
procedure TForm1.btnCreateClick(Sender: TObject); begin CreateDirectory(PChar(ExtractFilePath(ParamStr(0))+’Test’),nil); end; |
procedure TForm1.btnDeleteClick(Sender: TObject); var T:TSHFileOpStruct; P:String; begin P:=ExtractFilePath(ParamStr(0))+’Test’; with T do begin Wnd:=0; wFunc:=FO_DELETE; pFrom:=PChar(P); pTo:=nil; fFlags:=FOF_ALLOWUNDO+FOF_NOERRORUI; hNameMappings:=nil; lpszProgressTitle:=’正在删除文件夹’; fAnyOperationsAborted:=False; end; SHFileOperation(T); end; |
unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ShellApi; type TForm1 = class(TForm) btnCreate: TButton; btnDelete: TButton; procedure btnCreateClick(Sender: TObject); procedure btnDeleteClick(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.btnCreateClick(Sender: TObject); begin CreateDirectory(PChar(ExtractFilePath(ParamStr(0))+’Test’),nil); end; procedure TForm1.btnDeleteClick(Sender: TObject); var T:TSHFileOpStruct; P:String; begin P:=ExtractFilePath(ParamStr(0))+’Test’; with T do begin Wnd:=0; wFunc:=FO_DELETE; pFrom:=PChar(P); pTo:=nil; fFlags:=FOF_ALLOWUNDO+FOF_NOERRORUI; hNameMappings:=nil; lpszProgressTitle:=’正在删除文件夹’; fAnyOperationsAborted:=False; end; SHFileOperation(T); //RemoveDirectory(PChar(ExtractFilePath(ParamStr(0))+’Test’)); end; end. |
图2 程序运行的初始画面 |
评论 {{userinfo.comments}}
{{child.content}}
{{question.question}}
提交