Webbrowser i używanie ENTERA

0

Witam, otóż napisałem niedawno prostą przeglądarkę internetową.
Chodzi mi o użycie ENTERA w zawartości TWebbrowser, ponieważ ogólnie ENTER śmiga.
Ale jeśli chodzi o np. tekst na forum, lub wyszukiwarkę google.pl to ENTERa niestety nie można użyć.

Szukałem na forum rozwiązania problemu, ale to nie przyniosło rezultatu.
Proszę o pomoc i pozdrawiam :)

0

Witam! Proszę o pomoc!
Na forum znalazłem tylko kod:

var
iOIPAO: IOleInPlaceActiveObject;
Dispatch: IDispatch;
begin
if (WebBrowser1 = nil) then begin
Handled := False; Exit;
end;

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

if (Handled) and (not WebBrowser1.Busy) then begin
if FOleInPlaceActiveObject = nil then begin
Dispatch := WebBrowser1.Application;
if Dispatch <> nil then begin
Dispatch.QueryInterface (IOleInPlaceActiveObject, iOIPAO);
if iOIPAO <> nil then
FOleInPlaceActiveObject := iOIPAO;
end;
end;
if FOleInPlaceActiveObject <> nil then
if not (((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 FOleInPlaceActiveObject.TranslateAccelerator (Msg);
end;
end;

Ale kompletnie nie wiem co z nim zrobić! Proszę o pomoc, jestem jeszcze początkującym programistą!

0
uses
ActiveX;

private
    FOleInPlaceActiveObject: IOleInPlaceActiveObject;
    procedure MsgHandler(var Msg: TMsg; var Handled: Boolean);

procedure TForm1.MsgHandler(var Msg: TMsg; var Handled: Boolean);
const
  StdKeys = [VK_BACK, VK_UP, VK_DOWN, VK_LEFT, VK_RIGHT];
var IOIPAO: IOleInPlaceActiveObject;
  Dispatch: IDispatch;
begin
  if WebBrowser1 = nil then
  begin
    Handled := False;
    Exit;
  end;
  Handled := (IsDialogMessage(WebBrowser1.Handle, Msg) = True);
  if (Handled) and (not WebBrowser1.Busy) then
  begin
    if FOleInPlaceActiveObject = nil then
    begin
      Dispatch := WebBrowser1.Application;
      if Dispatch <> nil then
      begin
        Dispatch.QueryInterface(IOleInPlaceActiveObject, IOIPAO);
        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 in StdKeys) then
        //nothing  -  do not pass on Backspace, Left, Right, Up, Down arrows
      else FOleInPlaceActiveObject.TranslateAccelerator(Msg);
  end;
end;


procedure TForm1.FormCreate(Sender: TObject);
begin
Application.OnMessage := MsgHandler;
end;

procedure TForm1.FormDestroy(Sender: TObject);
begin
FOleInPlaceActiveObject := nil;
end;


initialization
  OleInitialize(nil);

finalization
  OleUninitialize

1 użytkowników online, w tym zalogowanych: 0, gości: 1