Link to home
Start Free TrialLog in
Avatar of rayek007
rayek007

asked on

Alt+F4

How can I disable a form's Alt+f4 event without modifying the on close querry event(canclose:=false)
ASKER CERTIFIED SOLUTION
Avatar of ILE
ILE

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Slavak
Slavak

when you press Alt+F4, windows sends WM_CLOSE message to currently active window.

If you want to change the default behaviuor just ovveride the message:


Type
  TForm1 = class(TForm)
  ...
  private
    procedure WMClose(var Msg : TMessage); message WM_CLOSE;
  ...
  end;


procedure TForm1.WMClose(var Msg : TMessage);
begin
// for default behaviour call to inherited
end;




rayek007:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
Hi!
No comment has been added lately and this question is therefore classified abandoned.

If asker wishes to close the question, then refer to
https://www.experts-exchange.com/help/closing.jsp

Otherwise, I will leave a recommendation in the Cleanup topic area that this question is:

Split between ILE and BTecho

Please leave any comments here within the next seven days. It is assumed that any participant not responding to this request is no longer interested in its final disposition.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

...Snehanshu
EE Cleanup Volunteer

P.S.
  Only 50 points so can't give points to Slavak also.
Forced accept

Computer101
E-E Admin