Hi,
to have the key preview I put the define clause {$DEFINE KEY_PREVIEW} in the KOL.pas, after {$DEFINE GDI}.
Then set the TKOLform.KeyPreview := TRUE.
Some buttons are managed by operating system so if you want to manage, for example, the Green button, you should tell to operating system (I put in the form creation):
SendMessage(SHFindMenuBar(form.Handle), SHCMBM_OVERRIDEKEY, VK_TTALK, MAKELPARAM(SHMBOF_NODEFAULT OR SHMBOF_NOTIFY, SHMBOF_NODEFAULT OR SHMBOF_NOTIFY));
where VK_TTALK=VK_F3;
After that, the OnMessage event of the TKOLForm will be called every button is pressed, and to know if it's the Green button
if (msg.message = WM_HOTKEY) then begin
case Hi(msg.lParam) of
VK_TTALK: ...
end;
end;
That's all
bye
Alberto