Place an applicationevents control in form,
Write the following code in the onmessage event:
Uses ActiveX
Procedure tform1.applicationevents1message (var msg: tagmsg;
VaR handled: Boolean );
Const
Stdkeys = [vk_tab, vk_return, vk_delete, vk_back]; {standard keys}
Extkeys = [vk_left, vk_right]; {extended keys}
Fextended = $01000000; {extended key flag}
Begin
Handled: = false;
With MSG do
If (Message> = wm_keyfirst) and (Message <= wm_keylast) and
(Wparam in stdkeys) or {$ ifdef ver120} (getkeystate (vk_control) <0) or {$ endif}
(Wparam in extkeys) and (lparam and fextended) = fextended) then
Try
If ischild (webbrowser1.handle, hwnd) then
{Handles all browser related messages}
Begin
With webbrowser1.application as ioleinplaceactiveobject do
Handled: = translateaccelerator (MSG) = s_ OK;
If not handled then
Begin
Handled: = true;
Translatemessage (MSG );
Dispatchmessage (MSG );
End;
End;
Except
End;
End;