delphi3000.com - the free delphi knowledge platform
delphi3000.com - the free delphi knowledge platform
Have a look at your member-status

connecting people's knowledge


  - Recent ArticlesRSS feed for Recent Articles on delphi3000.com
  - List of All Articles
  - Top Viewed Articles
  - Articles (+Attachem.)
  - Articles Of Interest
  - Categories
  - Top Uploader
  - Search
  - Index

  - My Home
  - Submit an Article
  - My Articles
  - My Personal Data
  - My Bookmarks
  - Activities
  - Login/Logout

  - Sign Up
  - Why Sign Up
  - Newsletter

  - Press
  - Advertise

  - Contact
  - Feedback





Community
Borland
ClubeDelphi
Dr. Bob
UK-BUG
Delphi Meetings
Planeta Delphi







Startblatt.de






Share this article with friendsShare this article with friends
Rate this articleRate this article - to keep the quality of delphi3000.com !
Comment this article or read through previous comments (1)


to display a Property dialog for file, folder or driveGo to Mike Shkolnik's websiteFormat this article printer-friendly!Bookmark function is only available for registered users!
Product:
Delphi all versions
Category:
Shell API
Skill Level:
Scoring:
Last Update:
04/19/2003
Search Keys:
delphi delphi3000 article borland vcl code-snippet property dialog file drive folder ShowFilePropertiesDialog SHELLEXECUTEINFO ShellExecuteEx SEE_MASK_NOCLOSEPROCESS SEE_MASK_INVOKEIDLIST SEE_MASK_FLAG_NO_UI TShellExecuteInfo
Times Scored:
2
Visits:
3042
Uploader: Mike Shkolnik
Company: Scalabium Software
Reference: http://www.scalabium.com/faq/dct0151.htm
 
Question/Problem/Abstract:
How display the standard Property dialog for file, folder or drive?
Answer:



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





Please rate this article!
Skill level:
BeginnerExpert

Useful:
No!Very!

Overall rating:
PoorExcellent



Comments to this article
Write a new comment
Show in Modal
    John Doe (Nov 18 2004 6:32AM)

any way i can show the window in modal mode ?
Respond














 
Sign up to consume product discounts for Bronze memberships !

read more


  Visit our Sponsor

 

  Community Ad of
M. Shkolnik
 
   














 







     
  Copyright © 2000 - 2007 delphi3000.com - All rights reserved. Terms of use. || Privacy
delphi3000.com is a service by bluestep.com IT-Services GmbH (Vienna)