title: How to switch the 'current' directory of a TOpenDialog in an OnTypeChange handler? (is it possible at all?)
body: <p>Depending on the chosen filter, I'd like the OpenDialog to 'look' in different directries.
  Something like:</p>
  
  <pre><code>procedure TForm1.FileOpen1OpenDialogTypeChange(Sender: TObject);
  // This does not work as intended...
  var
    Dialog: TOpenDialog;
    FilterIndex: Integer;
    FilterExt: string;
    Path: string;
  begin { TForm1.actFileOpenOpenDialogTypeChange }
    Dialog := Sender as TOpenDialog;
    FilterIndex := Dialog.FilterIndex;
    FilterExt := ExtFromFilter(Dialog.Filter, FilterIndex);
    GetIniPathForExtension(FilterExt, Path);
    if DirectoryExists(Path) and
       (Path &lt;&gt; IncludeTrailingPathDelimiter(Dialog.InitialDir)) then
    begin
      // those two statements don't have the desired effect
      // but illustrate what is meant to happen:
      Dialog.FileName := Path + '*' + FilterExt;
      Dialog.InitialDir := Path;
    end;
  end;  { TForm1.actFileOpenOpenDialogTypeChange }
  </code></pre>
  
  <p>I can't find any way to let the dialog update itself to the new directory.
  I've tried calling OpenDialog.Execute, but that starts another OpenDialog without closing the current one...</p>