unit WinForm4;

interface

uses
  System.Drawing, System.Collections, System.ComponentModel,
  System.Windows.Forms, System.Data, System.Runtime.InteropServices;

type
  TWinForm1 = class(System.Windows.Forms.Form)
  {$REGION 'Designer Managed Code'}
  strict private
    /// <summary>
    /// Required designer variable.
    /// </summary>
    Components: System.ComponentModel.Container;
    Button1: System.Windows.Forms.Button;
    Button2: System.Windows.Forms.Button;
    /// <summary>
    /// Required method for Designer support - do not modify
    /// the contents of this method with the code editor.
    /// </summary>
    procedure InitializeComponent;
    procedure Button1_Click(sender: System.Object; e: System.EventArgs);
    procedure Button2_Click(sender: System.Object; e: System.EventArgs);
  {$ENDREGION}
  strict protected
    /// <summary>
    /// Clean up any resources being used.
    /// </summary>
    procedure Dispose(Disposing: Boolean); override;
  private
    { Private Declarations }
  public
    constructor Create;
  end;

  [assembly: RuntimeRequiredAttribute(TypeOf(TWinForm1))]

function OknoDiskInfo(modalne :Boolean; szerokosc :Integer) :IntPtr; external 'Project1.dll';
procedure UsunOkno; external 'Project1.dll';

[DllImport('Project1.dll',EntryPoint='OknoDiskInfo')]
function OknoDiskInfo1(modalne :Boolean; szerokosc :Integer) :IntPtr; external;

[DllImport('Project1.dll',EntryPoint='UsunOkno')]
procedure UsunOkno1; external;

implementation

{$AUTOBOX ON}

{$REGION 'Windows Form Designer generated code'}
/// <summary>
/// Required method for Designer support -- do not modify
/// the contents of this method with the code editor.
/// </summary>
procedure TWinForm1.InitializeComponent;
begin
  Self.Button1 := System.Windows.Forms.Button.Create;
  Self.Button2 := System.Windows.Forms.Button.Create;
  Self.SuspendLayout;
  // 
  // Button1
  // 
  Self.Button1.Location := System.Drawing.Point.Create(8, 8);
  Self.Button1.Name := 'Button1';
  Self.Button1.Size := System.Drawing.Size.Create(96, 23);
  Self.Button1.TabIndex := 0;
  Self.Button1.Text := 'Twórz okno';
  Include(Self.Button1.Click, Self.Button1_Click);
  // 
  // Button2
  // 
  Self.Button2.Location := System.Drawing.Point.Create(112, 8);
  Self.Button2.Name := 'Button2';
  Self.Button2.Size := System.Drawing.Size.Create(96, 23);
  Self.Button2.TabIndex := 1;
  Self.Button2.Text := 'Usuń okno';
  Include(Self.Button2.Click, Self.Button2_Click);
  // 
  // TWinForm1
  // 
  Self.AutoScaleBaseSize := System.Drawing.Size.Create(6, 15);
  Self.ClientSize := System.Drawing.Size.Create(360, 144);
  Self.Controls.Add(Self.Button2);
  Self.Controls.Add(Self.Button1);
  Self.Name := 'TWinForm1';
  Self.Text := 'OknoDiskInfo (Windows Forms)';
  Self.ResumeLayout(False);
end;
{$ENDREGION}

procedure TWinForm1.Dispose(Disposing: Boolean);
begin
  if Disposing then
  begin
    if Components <> nil then
      Components.Dispose();
  end;
  inherited Dispose(Disposing);
end;

constructor TWinForm1.Create;
begin
  inherited Create;
  //
  // Required for Windows Form Designer support
  //
  InitializeComponent;
  //
  // TODO: Add any constructor code after InitializeComponent call
  //
end;

procedure TWinForm1.Button2_Click(sender: System.Object; e: System.EventArgs);
begin
UsunOkno;
end;

procedure TWinForm1.Button1_Click(sender: System.Object; e: System.EventArgs);
begin
OknoDiskInfo(False,640);
end;

end.
