unit dlgmod;

interface

uses
  Windows, SysUtils, Types, UITypes, Classes, Controls, Forms, Dialogs, Graphics;

type
  TFileOpenDialog = class(Dialogs.TFileOpenDialog)
  public
    function Execute(ParentWnd: HWND): Boolean; override;
  end;

  TFileSaveDialog = class(Dialogs.TFileSaveDialog)
  public
    function Execute(ParentWnd: HWND): Boolean; override;
  end;

  TPrintDialog = class(Dialogs.TPrintDialog)
    function Execute(ParentWnd: HWND): Boolean; override;
  end;

  TPrinterSetupDialog = class(Dialogs.TPrinterSetupDialog)
    function Execute(ParentWnd: HWND): Boolean; override;
  end;

  TWin32ColorDialog = class(Dialogs.TColorDialog)
    function Execute(ParentWnd: HWND): Boolean; override;
  end;

  TFontDialog = class(Dialogs.TFontDialog)
    function Execute(ParentWnd: HWND): Boolean; override;
  end;

implementation

{ TFileOpenDialog }

function TFileOpenDialog.Execute(ParentWnd: HWND): Boolean;
begin
  Application.ModalStarted;
  try
    Result := inherited Execute(ParentWnd);
  finally
    Application.ModalFinished;
  end;
end;

{ TFileSaveDialog }

function TFileSaveDialog.Execute(ParentWnd: HWND): Boolean;
begin
  Application.ModalStarted;
  try
    Result := inherited Execute(ParentWnd);
  finally
    Application.ModalFinished;
  end;
end;

{ TPrintDialog }

function TPrintDialog.Execute(ParentWnd: HWND): Boolean;
begin
  Application.ModalStarted;
  try
    Result := inherited Execute(ParentWnd);
  finally
    Application.ModalFinished;
  end;
end;

{ TPrinterSetupDialog }

function TPrinterSetupDialog.Execute(ParentWnd: HWND): Boolean;
begin
  Application.ModalStarted;
  try
    Result := inherited Execute(ParentWnd);
  finally
    Application.ModalFinished;
  end;
end;

{ TWin32ColorDialog }

function TWin32ColorDialog.Execute(ParentWnd: HWND): Boolean;
begin
  Application.ModalStarted;
  try
    Result := inherited Execute(ParentWnd);
  finally
    Application.ModalFinished;
  end;
end;

{ TFontDialog }

function TFontDialog.Execute(ParentWnd: HWND): Boolean;
begin
  Application.ModalStarted;
  try
    Result := inherited Execute(ParentWnd);
  finally
    Application.ModalFinished;
  end;
end;

end.
