Using the following
explorer.exe /select, "c:\path\to\file.txt"
I can open Windows Explorer and select the file. In Delphi I do this to select "Parm" file:
ShellExecute(Application.MainForm.Handle, 'OPEN', PChar('explorer.exe'), PChar('/select,"' + Parm + '"'), nil, SW_NORMAL);
And it works. My problem is this: if I select a different file in the recently opened Explorer (clicking in a different file) and then call the above code the "Parm" file is not selected again. Interestingly, there are some programs that select the file again. For instance, ITunes always selects the desired file.
Does anyone have a clue of how to make Explorer always select the specified file?