title: Reading the output file of ShellExecute() in Delphi 2010?
body: <p>I use the ShellExecute command to run an exe file which gets an input text file and returns an output text file. I've written it like this:</p>
  
  <pre><code>ShellExecute(mainFormHandle, 'open', 'Test.exe',
      'input.txt output.txt', nil, sw_shownormal);
  
  //Read the output file...
  S_List.LoadFromFile('output.txt');
  Writeln(S_List[0])
  </code></pre>
  
  <p>I provide the input.txt file before running this command. In each run of my program, the input file changes and so does the output file.</p>
  
  <p>The problem is this: I can't see the changes in the output file! The line written in the console is from the previous file, not the newly changes one. I mean, the file in the explorer is changed but the file that I read is still the old file.</p>
  
  <p>It seems a little weird, but I was wondering is there any way to refresh the output file before reading it? Or I am missing something here?</p>
  
  <p>Thanks in advance.   </p>