unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ZamknijSystem;

type
  TForm1 = class(TForm)
    ComboBox1: TComboBox;
    CheckBox1: TCheckBox;
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var Action : Integer;
begin
if (ComboBox1.ItemIndex=-1) then Exit;
case (ComboBox1.ItemIndex) of
  0: Action:=EWX_LOGOFF;
  1: Action:=EWX_SHUTDOWN;
  2: Action:=EWX_POWEROFF;
  3: Action:=EWX_REBOOT;
  else Action:=EWX_LOGOFF;
  end;
if (CheckBox1.Checked) then Action:=Action or EWX_FORCE;
ZamknijSystem1(Action);
end;

end.
