Question:
I dont want my application killed by Alt+F4.
Possible?
Answer:
Sure, here the code:
public
procedure AppMessage(var Msg: TMSG; var HAndled: Boolean);
end;
{...}
implementation
{...}
procedure TForm1.FormCreate(Sender: TObject);
begin
Application.OnMessage := AppMessage;
end;
procedure TForm1.AppMessage(var Msg: TMSG; var Handled: Boolean);
begin
Handled := False;
case Msg.Message of
WM_SYSKEYDOWN:
if Msg.wParam = VK_F4 then
Handled := True; // don't allow ALT-F4
end;
end;
Subscribe to:
Post Comments (Atom)






0 Responses so far.
Post a Comment
Thank you for your comment.
Any request and idea are welcome.