ITXP365(智码IT网)

分享电脑知识,传播IT技巧

致敬爱学习的您,祝您访问愉快!

Delphi打开exe 打开文件夹 打开文件夹选中行文件


发布:智码IT网   阅读:53
//打开windows自带 计算器 程序 calc.exe   
//注意:需要引用Winapi.ShellAPI,Winapi.Windows
//use Winapi.ShellAPI,Winapi.Windows;
ShellExecute(Application.Handle, 'open', PWideChar('calc.exe'), '-s', '', SW_SHOWNORMAL);


//打开自身exe文件所在文件夹sDir  
//注意:需要引用Winapi.ShellAPI
var sDir := ExtractFilePath(Application.ExeName);
// uses Winapi.ShellAPI;
ShellExecute(Handle, 'open', 'Explorer.exe', PChar(sDir), nil, 1);


//打开文件夹 选中文件 
var strZipPath := 'D:\test.zip';
ShellExecute(Handle,nil,'explorer',PChar('/select,'+strZipPath),nil,SW_SHOWNORMAL);

© 2001-2025智码IT网 www.itxp365.com版权所有

蜀ICP备2021001527号