I have a form in a Delphi project. There is a button on the form. When the user clicks the button, I want it to open Windows Explorer.
What code will I need to achieve this?
Well in case you need to select some particular file in explorer I have the following function which I use
procedure SelectFileInExplorer(const Fn: string);
begin
ShellExecute(Application.Handle, 'open', 'explorer.exe',
PChar('/select,"' + Fn+'"'), nil, SW_NORMAL);
end;
and you can call it :
SelectFileInExplorer('C:\Windows\notepad.exe');
EDIT: As mentioned ShellAPI must be added to your uses list