Outside or inside the program?
From the TOpenDialog (which encapsulates the explorer) it is simply reading the property Filename....
For the explorer itself (windows assumed) you need the COM library for explorer, which you can generate from the explorer itself.