Fórum Desabilitar maximizar e minimizar ... #256415
28/10/2004
0
Valew!!
Cicerojr
Curtir tópico
+ 0Posts
29/10/2004
Cicerojr
Gostei + 0
03/11/2004
Cicerojr
Gostei + 0
04/11/2004
Cicerojr
Gostei + 0
08/11/2004
Cicerojr
Gostei + 0
08/11/2004
Christian_adriano
vc pode fazer da seguinte forma :
{********************* Botão Fechar **************************}
function DesabilitarBotaoFECHAR(Form : TForm) : Boolean;
var
hfechar: THANDLE;
hMenuFechar: HMenu;
begin
hfechar := Form.Handle;
if (hfechar <> 0) then
begin
hMenuFechar := GetSystemMenu(hfechar, FALSE);
if (hMenuFechar <> 0) then
DeleteMenu(hMenuFechar, SC_CLOSE, MF_BYCOMMAND);
end;
Result := false;
end;
{********************* Botão Maximizar ***********************}
function DesabilitarBotaoMAXIMIZAR(Form : TForm) : Boolean;
var
hMAXIMIZAR: THANDLE;
hMenuMAXIMIZAR: HMenu;
begin
hMAXIMIZAR := Form.Handle;
if (hMAXIMIZAR <> 0) then
begin
hMenuMAXIMIZAR := GetSystemMenu(hMAXIMIZAR, FALSE);
if (hMenuMAXIMIZAR <> 0) then
DeleteMenu(hMenuMAXIMIZAR, SC_MAXIMIZE, MF_BYCOMMAND);
end;
Result := false;
end;
{********************* Botão Minimizar ***********************}
function DesabilitarBotaoMINIMIZE(Form : TForm) : Boolean;
var
hMINIMIZE: THANDLE;
hMenuMINIMIZE: HMenu;
begin
hMINIMIZE := Form.Handle;
if (hMINIMIZE <> 0) then
begin
hMenuMINIMIZE := GetSystemMenu(hMINIMIZE, FALSE);
if (hMenuMINIMIZE <> 0) then
DeleteMenu(hMenuMINIMIZE, SC_MINIMIZE, MF_BYCOMMAND);
end;
Result := false;
----------------------
Para usa-lo é só vc informa qual é o forma q vc deseja desabilita-lo.
Ex. DesabilitarBotaoMAXIMIZAR(FormClientes);
Espero ter ajudado.
[]´s.
Christian.
end;
Gostei + 0
08/11/2004
Cicerojr
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)