{*******************************************************}
{                                                       }
{       Pascal Script Source File                       }
{       Run by RemObjects Pascal Script in CnWizards    }
{                                                       }
{       Generated by CnPack IDE Wizards                 }
{                                                       }
{*******************************************************}

program SetOpenDir;

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;

const
  SOpenFileDialogName = 'OpenFileDialog';

var
  AppBuilder, Dialog: TComponent;
begin
  AppBuilder := Application.FindComponent('AppBuilder');
  if AppBuilder <> nil then
  begin
    Dialog := AppBuilder.FindComponent(SOpenFileDialogName);
    if (Dialog <> nil) and (Dialog is TOpenDialog) then
    begin
      TOpenDialog(Dialog).InitialDir := 'C:\';
      InfoDlg('Open Dialog''s InitialDir set to C:\');
    end;
  end;
end.
 
