title: Initial Directory on filedialog in Delphi
body: <p>I need to know how to set the initial directory using the example from this link.</p>
  
  <p><a href="https://stackoverflow.com/questions/10998309/tfileopendialog-in-firemonkey-application">TFileOpenDialog in FireMonkey Application</a></p>
  
  <p>Here is the code I am using, It works fine other than being able to set the initial folder.</p>
  
  <pre><code>function WinVistaSelectFolder: String; 
  var
    FileDialog: IFileDialog;
    hr: HRESULT;
    IResult: IShellItem;
    initfldr:ishellitem;
    FileName: PWideChar;
    Settings: Cardinal;
    Title: String;
  begin
    hr := CoCreateInstance (CLSID_FileOpenDialog,nil,CLSCTX_INPROC_SERVER,IFileDialog, FileDialog);
    if hr = S_OK then
    begin
      FileDialog.GetOptions(Settings);
      Settings := Settings or FOS_PICKFOLDERS or FOS_FORCEFILESYSTEM;
      FileDialog.SetOptions(Settings);
      FileDialog.SetOkButtonLabel('Select');
       Title := 'Select a directory';
      FileDialog.SetTitle(PWideChar(Title));
      hr := FileDialog.Show(0);
      if hr = S_OK then
      begin
        hr := FileDialog.GetResult(IResult);
        if hr = S_OK then
        begin
          IResult.GetDisplayName(SIGDN_FILESYSPATH, FileName);
          Result := FileName;
        end;
      end;
    end;
  end;
  </code></pre>