首页  编辑  

文件属性对话框

Tags: /超级猛料/VCL/Common.Dialog.通用对话框和控件/   Date Created:

function SHFileProperties(handle:hwnd;uflags:dword;name:pchar;str:pchar):dword;stdcall;external 'shell32.dll' index 178;

uFlags=1/2;

name:Filename;

str:好像不起作用

其实只是调用ShellExecuteEX

看下面的例子

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:\', Handle);

end;