procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
SystemParametersInfo(Spi_screensaverrunning,1,0,0);
if (Key=VK_F4) and (ssAlt in shift) then
Key :=0;
end;
procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
if Application.MessageBox('真的要退出吗?', '提示', MB_YESNO+MB_ICONQUESTION) = ID_no then
CanClose:=false
else
CanClose:=true;
if CanClose then Application.terminate;
end;