At second glance, it may be that not the whole record is passed.
I will have a look at third glance, because that would maybe be a bug since it suggests you have not all message information. and that is bad...
Anyway for the answer to LM_KEYDOWN the answer should be correct.
better solution is along these lines:
type
TForm1 = class(TForm)
procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
private
{ private declarations }
public
{ public declarations }
end;
var
Form1: TForm1;
procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
begin
if Key = VK_K then
ShowMessage('K key pressed!');
end;
that may be sufficient. You can also apply this to controls instead of the form, of course.