(* uses UxTheme;
procedure TForm2.FormActivate(Sender: TObject);
begin
SetWindowTheme(Handle, '', '');
end; *)
const
count = 3;
var
NochNichtGespeichert: boolean = true;
OldColors: array [0 .. count - 1] of TColor;
DisplayElements: array [0 .. count - 1] of integer = (
COLOR_BTNHIGHLIGHT,
COLOR_ACTIVECAPTION,
COLOR_WINDOW
);
NewColors: array [0 .. count - 1] of TColor = (
clRed,
clGreen,
clYellow
);
// Farben tauschen
procedure TForm2.Button1Click(Sender: TObject);
var
x: integer;
begin
if NochNichtGespeichert then
begin
for x := 0 to count - 1 do
OldColors[x] := getsyscolor(DisplayElements[x]);
NochNichtGespeichert := false;
end;
setsyscolors(count, DisplayElements, NewColors);
end;
// alte Einstellung wieder herstellen
procedure zurueck;
begin
if NochNichtGespeichert then
exit;
setsyscolors(count, DisplayElements, OldColors);
NochNichtGespeichert := true;
end;
procedure TForm2.Button2Click(Sender: TObject);
begin
zurueck;
end;
procedure TForm2.FormClose(Sender: TObject; var Action: TCloseAction);
begin
zurueck;
end;