For Newbie

Tuesday, 15 November 2011

Open Containing Folder by delphi

Tricks to open the directory and its files / folders that have happened-select (such as when to execute the menu Open Containing Folder in Windows search results).

Function declaration:
OpenContainingFolder procedure (FileName: String);
   ShellExecute (Application.Handle, nil, 'explorer',
                PChar ('/ select, "' + FileName +'"'), nil, SW_SHOWNORMAL);

Add ShellAPI units in uses.

Example of implementation:
procedure TForm1.Button1Click (Sender: TObject);
   OpenContainingFolder ('C: \ WINDOWS');

Share on Facebook
Share on Twitter
Share on Google+

Related : Open Containing Folder by delphi