Registriert seit: 15. Nov 2004
2.647 Beiträge
|
Re: Alt F4 sperren
27. Nov 2005, 13:09
Delphi-Quellcode:
type
TForm1 = class(TForm)
procedure WMSysCommand( var Message: TWMSysCommand);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
procedure AppMessage( var Msg: TMSG; var HAndled: Boolean);
end;
// ...
// Das hier ist unwichtig, ist eine andere Sache. Nur dazu da um spätere Fragen vom Tisch zu räumen.
procedure TForm1.WMSysCommand( var Message: TWMSysCommand);
begin
if Message.CmdType and $FFF0 = SC_MINIMIZE then
Hide
else
inherited;
end;
procedure TForm1.AppMessage( var Msg: TMSG; var Handled: Boolean);
begin
// let your application handle all messages initially
Handled := False;
case Msg. Message of
WM_SYSKEYDOWN:
if Msg.wParam = VK_F4 then
Handled := True; // don't allow ALT-F4
end;
end;
|
|
Zitat
|