Same old problem with keys not happening.

I am trying to use some code found on a previous thread, but having
problems.
The actual problem with the browser control is that the enter key does not
work in a multi-line textarea.

Is this the correct way to get all keys working in the control, or is there
a better way?

Cheers,
Dave.

HTML: TWebBrowser ;

procedure TBrowseForm.AppMessage(var Msg: TMsg; var Handled: Boolean);

var
  iOIPAO: IOleInPlaceActiveObject;
  Dispatch: IDispatch;

begin
{ exit if we don't get back a webbrowser object }
  if HTML = nil then
  begin
    Handled := False;
    Exit;
  end;

  Handled:=(IsDialogMessage(HTML.Handle, Msg) = True);

  if (Handled) and (not HTML.Busy) then
  begin
    if FOleInPlaceActiveObject = nil then
    begin
      Dispatch := HTML.Application;
!!![Error] WebBrowser.pas(145): Incompatible types: 'OLE2.IDispatch' and
'System.IDispatch'
      if Dispatch <> nil then
      begin
        Dispatch.QueryInterface(IOleInPlaceActiveObject, iOIPAO);
!!![Error] WebBrowser.pas(148): Incompatible types: 'TGUID' and 'Class
reference'
        if iOIPAO <> nil then
          FOleInPlaceActiveObject := iOIPAO;
      end;
    end;

    if FOleInPlaceActiveObject <> nil then
      if ((Msg.message = WM_KEYDOWN) or (Msg.message = WM_KEYUP)) and
         ((Msg.wParam = VK_BACK) or (Msg.wParam = VK_LEFT) or
          (Msg.wParam = VK_RIGHT)) then
      //nothing - do not pass on Backspace, Left or Right arrows
      else
        FOleInPlaceActiveObject.TranslateAccelerator(Msg);
  end;
end ;
---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"

Reply via email to