unit WinForm;
interface
uses
System.Drawing, System.Collections, System.ComponentModel,
System.Windows.Forms, System.Data;
...
uses System.Diagnostics, System.IO, registry, Windows;
procedure TWinForm.Beenden_Click(sender: System.
Object; e: System.EventArgs);
begin
case MessageBox.Show('
Wollen sie das Setup wirklich Beenden', '
Setup', MessageBoxButtons.YesNo,
Messageboxicon.Warning, Messageboxdefaultbutton.button1)
of
System.Windows.Forms.DialogResult.Yes : close;
end;
end;
procedure TWinForm.Zurück_Click(sender: System.
Object; e: System.EventArgs);
begin
Panel1.Hide;
ListBox1.items.Clear;
end;
procedure TWinForm.Insatll_Click(sender: System.
Object; e: System.EventArgs);
var
reg : TRegistry;
begin
try
reg := TRegistry.Create;
reg.RootKey := HKEY_LOCAL_MACHINE;
reg.OpenKey('
SOFTWARE\Policies\Microsoft\Windows\System\Shutdown',true);
reg.WriteInteger('
HibernateAsDefault',1);
reg.WriteInteger('
ShowHibernateButton',1);
finally
reg.Free;
end;
end;
procedure TWinForm.Beenden1_Click(sender: System.
Object; e: System.EventArgs);
begin
case MessageBox.show('
Wollen sie das Setup wirklich Beenden', '
Setup', MessageBoxButtons.YesNo,
Messageboxicon.Warning, Messageboxdefaultbutton.button1)
of
System.Windows.Forms.DialogResult.Yes : close;
end;
end;
end.