Man kann auch das ganze Geklicke "da oben" abfangen, wenn man will...
Delphi-Quellcode:
...
protected
procedure WMNCLBUTTONDOWN(var msg: TMessage); message WM_NCLBUTTONDOWN;
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.WMNCLBUTTONDOWN(var msg: TMessage);
begin
if cbCLOSE.Checked then inherited; // NO CLOSE if deactivated / unchecked
// cbCLOSE kann man durch eine PW-Abfrage ersetzen, ALT-F4 muss geblockt werden
if msg.wParam = HTCAPTION then
begin
Caption:= 'HTCAPTION'; Exit;//
end;
if msg.wParam = HTSYSMENU then
begin
Caption:= 'HTSYSMENU'; Exit;//
end;
if msg.wParam = HTCLIENT then
begin
Caption:= 'HTCLIENT'; Exit;//
end;
if msg.wParam = HTCLOSE then
begin
Caption:= 'HTCLOSE'; Exit;//
end;
if msg.wParam = HTMAXBUTTON then
begin
Caption:= 'HTMAXBUTTON'; Exit;//
end;
if msg.wParam = HTMINBUTTON then
begin
Caption:= 'HTMINBUTTON'; Exit;//
end;
end;