给出一个文件名称,如何获取EXE或DLL文件的内部名称文件属性。如果有代码最好,急用。

解决方案 »

  1.   

    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;varsfi: TSHELLEXECUTEINFO;beginwith sfi dobegincbSize := 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);beginShowFileProperties('c:, Handle);end;