| Here's the code that will display the standard Windows Properties dialog for a specified file (object) name.
Usage: ShowProperties(Application.Handle, 'c:autoexec.bat')
Here's the function source.
function ShowProperties(hWndOwner: HWND; const FileName: string): boolean;
var
Info: TShellExecuteInfo;
Handle : THandle;
begin
{ Fill in the SHELLEXECUTEINFO structure }
with Info do
begin
cbSize := SizeOf(Info) ;
fMask := SEE_MASK_NOCLOSEPROCESS or
SEE_MASK_INVOKEIDLIST or
SEE_MASK_FLAG_NO_UI;
wnd := hWndOwner;
lpVerb := 'properties';
lpFile := pChar(FileName) ;
lpParameters := nil;
lpDirectory := nil;
nShow := 0;
hInstApp := 0;
lpIDList := nil;
end;
{ Call Windows to display the properties dialog. }
Result := ShellExecuteEx(@Info) ;
end;
|