Scalabium Software

SMReport Autogenerated

Knowledge for your independence.
Home Delphi and C++Builder tips



#151:To display a Property dialog for file, folder or drive

Sometimes you need show the standard dialog with file properties from own application (especially if you develop some file manager)

You may easy solve this task - just run next code:

function ShowFilePropertiesDialog(hWndOwner: HWND; const FileName: string):
Boolean;
var
  Info: TShellExecuteInfo;
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;

This is the same dialog box that Windows Explorer displays when viewing an object's properties. For example, from this dialog user can change permissions for folder or check free space for drive.

You may specify a file name or folder name or drive letter. For example:

ShowFilePropertiesDialog(Application.Handle, 'd:\debit.xls')
or
ShowFilePropertiesDialog(Application.Handle, 'd:\Oracle')
or
ShowFilePropertiesDialog(Application.Handle, 'd:\')
See also
 
SMExport suite
SMImport suite
SMReport
SMDBGrid
MAPIMail
Paradox Viewer
Paradox ActiveX
ExcelFile Viewer
Metafile Convert
DBLoad
DBExport tools
 
 
Contact to webmaster

 

Borland Software Code Gear Scalabium Delphi tips

Copyrightc 1998-2008, Scalabium Software. All rights reserved.
webmaster@scalabium.com

April 19, 2003

SMReport Autogenerated