본문 바로가기

Delphi/간단하게

간단하게 Alt + F4 종료 막기

폼의 키다운 이벤트에 아래 코드를 추가합니다.

procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
begin
  if (ssAlt in Shift) and (Key = VK_F4) then
    Key := 0;
end;

 

반응형