I have a procedure to open a folder in Windows Explorer that gets passed a directory path:
procedure TfrmAbout.ShowFolder(strFolder: string);
begin
ShellExecu
The answers at delphi.lonzu.net and swissdelphicenter offer a simpler solution to this. I've only tested it on Windows 10, 1909,, but the gist of it is:
uses ShellApi, ...
...
var
FileName : TFileName;
begin
FileName := 'c:\temp\somefile.html';
ShellExecute(Handle, 'OPEN',
pchar('explorer.exe'),
pchar('/select, "' + FileName + '"'),
nil,
SW_NORMAL);
end;
This is simple and easy to use. Whether it works with older versions of Windows, I don't know.