A. You create a dynamic method that is indexed to the message constant
that you want to override. If you want to override
the CM_DIALOGKEY
message you would declare the following procedure in the
public
section of you class declaration:
Procedure CMDialogKey(var Message: TCMDialogKey);message CM_DIALOGKEY;
It is common practice to declare the procedure name the
same as the
message name minus the underscore. Your message
handler would look
something like this:
Procedure TForm1.CMDialogKey(var Message: TCMDialogKey);
begin
if CharCode = VK_TAB then begin
{Process the Alt+Tab key here}
result := 1;
exit;
end;
inherited;
end;
Setting result to 1 stops further processing. The inherited
statement passes control to the parent handler. Be sure
to
execute inherited for all the cases you don't want to
handle.
Do not execute it for the ones you do handle.