调出文件属性对话框

uses ShellAPI;

function ShowFileProperties(FileName: String; Wnd: HWND):Boolean;

var

sfi: TSHELLEXECUTEINFO;

begin

with sfi do

begin

    cbSize := SizeOf(sfi);

    lpFile := PAnsiChar(FileName);

    Wnd := Wnd;

    fMask := SEE_MASK_NOCLOSEPROCESS or SEE_MASK_INVOKEIDLIST or SEE_MASK_FLAG_NO_UI;

    lpVerb := PAnsiChar('properties');

    lpIDList := nil;

    lpDirectory := nil;

    nShow := 0;

    hInstApp := 0;

    lpParameters := nil;

    dwHotKey := 0;

    hIcon := 0;

    hkeyClass := 0;

    hProcess := 0;

    lpClass := nil;

end;

Result := ShellExecuteEX(@sfi);

end;

procedure TForm1.Button1Click(Sender: TObject);

begin

   ShowFileProperties('c:\AA.txt', Handle);

end;


类别:Delphi 查看评论
posted @ 2010-01-26 00:15  一 点  阅读(168)  评论(0编辑  收藏  举报