如何通过api,shellexcute函数来察看文件属性

allensue 2003-10-24 09:34:37
如何通过api,shellexcute函数来察看文件属性,各位有代码,或实例吗?请赐教
...全文
49 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
wdonghai 2003-11-27
  • 打赏
  • 举报
回复
uses ShellApi;

procedure GetFileAttr(FileName:string);
var
sei:TSHELLEXECUTEINFO;
begin
ZeroMemory(@sei,sizeof(TSHELLEXECUTEINFO));
sei.cbSize := sizeof(sei);
sei.lpFile := PChar(FileName);
sei.lpVerb := 'properties';
sei.fMask := SEE_MASK_INVOKEIDLIST;
ShellExecuteEx(@sei);
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
if opendialog1.Execute then
GetFileAttr(opendialog1.FileName);
end;
sixgj 2003-11-26
  • 打赏
  • 举报
回复
◇[DELPHI]处理文件属性
attr:=filegetattr(filelistbox1.filename);
if (attr and faReadonly)=faReadonly then ... //只读
if (attr and faSysfile)=faSysfile then ... //系统
if (attr and faArchive)=faArchive then ... //存档
if (attr and faHidden)=faHidden then ... //隐藏

1,184

社区成员

发帖
与我相关
我的任务
社区描述
Delphi Windows SDK/API
社区管理员
  • Windows SDK/API社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧