Buscar

Como desabilitar o fechamento do form?

Código

  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;

Publicidade

Vote na dica




Quantidade de votos: 0 votos
Aceitação: 0%


Detalhes da dica

Categoria: Forms
Adicionada dia: 05/06/03
Por: Felipe Monteiro
Visualizada: 3068 vezes

Planeta Delphi - Tudo sobre programação Delphi Planeta Delphi - www.planetadelphi.com.br - Todos os direitos reservados | Copyright 2001-2009