Delphi打開任何Windows支持文件

来源:互联网 发布:深圳知豆电动汽车 编辑:程序博客网 时间:2024/06/06 02:06

{Delphi打開任何Windows支持文件,Use ShellAPI,Dialogs}
 
function ExecuteFile(const FileName, Params, Dir: string; ShowCmd: Integer): THandle;{封裝ShellExecute}
begin
  Result := ShellExecute(Application.MainForm.Handle, nil, PChar(FileName), PChar(Params), PChar(Dir), ShowCmd);
end;

if ExecuteFile(Filename, Params, path , SW_SHOW) <= 32 then
    MessageDlg('請確定文件是否存在,謝謝', mtError, [mbOk], 0)
else
   Application.Minimize;

原创粉丝点击