Tuesday, 15 November 2011
Home »
Tips and Trick Delphi
» Open Containing Folder by delphi
Open Containing Folder by delphi
To Share | Tuesday, 15 November 2011
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);
begin
ShellExecute (Application.Handle, nil, 'explorer',
PChar ('/ select, "' + FileName +'"'), nil, SW_SHOWNORMAL);
end;
Add ShellAPI units in uses.
Example of implementation:
procedure TForm1.Button1Click (Sender: TObject);
begin
OpenContainingFolder ('C: \ WINDOWS');
end;
No comments:
Post a Comment