1. Home
  2. Computing & Technology
  3. Delphi Programming

Display standard Windows Properties dialog

By , About.com Guide

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')

~~~~~~~~~~~~~~~~~~~~~~~~~
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;
~~~~~~~~~~~~~~~~~~~~~~~~~

Delphi tips navigator:
» How to draw rotated text
« How to check whether a string is all "upper case"

Explore Delphi Programming
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Delphi Programming
  4. Coding Delphi Applications
  5. Delphi Tips and Tricks
  6. 2003 Delphi Tips
  7. Display standard Windows Properties dialog

©2009 About.com, a part of The New York Times Company.

All rights reserved.