procedure SunkenButton(Bttn: TButtonControl; versunken: boolean);
begin
if versunken then
SetWindowLong(Bttn.Handle, GWL_EXSTYLE, WS_EX_CLIENTEDGE) else
SetWindowLong(Bttn.Handle, GWL_EXSTYLE, WS_EX_WINDOWEDGE);
SetWindowPos(Bttn.Handle, HWND_TOP, Bttn.left, Bttn.top,
Bttn.width, Bttn.height, SWP_FRAMECHANGED);
end;
// Beispielaufrufe
// versenken
procedure TForm1.Button1Click(Sender: TObject);
begin
SunkenButton(Button3, true);
SunkenButton(Button4, true);
end;
// normal
procedure TForm1.Button2Click(Sender: TObject);
begin
SunkenButton(Button3, false);
SunkenButton(Button4, false);
end;