unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, AHMSystemClass, AHMTDisplayManager;

type
  TForm1 = class(TForm)
    AHMDisplayManager1: TAHMDisplayManager;
    ComboBox1: TComboBox;
    Button1: TButton;
    Label3: TLabel;
    procedure ModeChange;
    procedure FormCreate(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure AHMDisplayManager1RestartRequest(Sender: TObject;
      var RebootNow: Boolean);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.ModeChange;
begin
  Combobox1.Clear;
  Combobox1.Items:=AHMDisplayManager1.Modes;
  Combobox1.ItemIndex:=Combobox1.Items.IndexOf(AHMDisplayManager1.CurrentMode);
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  ModeChange;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  AHMDisplayManager1.Mode:=Combobox1.Text;
  AHMDisplayManager1.Execute;
end;

procedure TForm1.AHMDisplayManager1RestartRequest(Sender: TObject;
  var RebootNow: Boolean);
begin
  if MessageDlg('Your system needs to be rebooted for changes to take effect. Do you want to do that now ?',mtconfirmation,[mbyes,mbno],0)=mryes then
   Rebootnow:=true else Rebootnow:=False;
end;

end.
