sábado, 12 de novembro de 2011

Como desabilitar as teclas Alt + F4


public
  { Public declarations }
  fecha: Boolean;
  end;

 implementation
 {$R *.DFM}

Function GetStateK (Key: integer): boolean;
begin
  Result := Odd (GetKeyState (Key));
end;

procedure Tfrm_HIP.FormClose(Sender: TObject; var Action: TCloseAction);
begin
If Not fecha Then
  Action := caNone 
Else
  Action := caFree;
end;

procedure Tfrm_HIP.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
   If GetStateK (VK_LMENU) And (Key = VK_F4) Then
      fecha := False;
end;

Nenhum comentário:

Postar um comentário