Einzelnen Beitrag anzeigen

rickleimbach

Registriert seit: 12. Aug 2004
14 Beiträge
 
Turbo Delphi für Win32
 
#6

Re: Twwebbrowser "return" Problem

  Alt 12. Aug 2004, 16:28
blub ? Matze oben lesn hab den link schon

Also hier mein code nach der änderung :

Delphi-Quellcode:
unit webbrows;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, OleCtrls, SHDocVw, Menus;

type
  TForm1 = class(TForm)
    WebBrowser1: TWebBrowser;
    Edit1: TEdit;
    Button1: TButton;
    button2: TButton;
    Button3: TButton;
    Button4: TButton;
    MainMenu1: TMainMenu;
    Datei1: TMenuItem;
    Beenden1: TMenuItem;
    Hilfe1: TMenuItem;
    Version1: TMenuItem;
    procedure Edit1KeyPress(Sender: TObject; var Key: Char);
    procedure Button1Click(Sender: TObject);
    procedure button2Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure Button4Click(Sender: TObject);
    procedure Beenden1Click(Sender: TObject);
    procedure Version1Click(Sender: TObject);
    procedure FormDestroy(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
    FOleInPlaceActiveObject: IoleInPlaceActiveObject;
    procedure MsgHandler(var Msg: TMsg; var Handled: Boolean);
  end;

var
  Form1: TForm1;

implementation

uses webbrowsform2;

{$R *.dfm}

procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
if
key= #13//
then
webbrowser1.navigate(edit1.text)

end;

procedure TForm1.Button1Click(Sender: TObject);
begin
webbrowser1.GoBack;
end;

procedure TForm1.button2Click(Sender: TObject);
begin
Webbrowser1.GoForward;
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
webbrowser1.Stop;
end;

procedure TForm1.Button4Click(Sender: TObject);
begin
webbrowser1.Refresh;
end;

procedure TForm1.Beenden1Click(Sender: TObject);
begin
application.Terminate;
end;

procedure TForm1.Version1Click(Sender: TObject);
begin
form2.showmodal;
end;
procedure TForm1.MsgHandler(var Msg: TMsg; var Handled: Boolean);
const
  DialogKeys: set of Byte = [VK_LEFT, VK_RIGHT, VK_BACK, VK_UP, VK_DOWN,
    $30..$39, $41..42, $44..$55, $57, $59..$5A];
var
  iOIPAO: IOleInPlaceActiveObject;
  Dispatch: IDispatch;
begin
  { exit if we don't get back a webbrowser object } 
  if (WebBrowser1 = nil) then
  begin
    Handled := System.False;
    Exit;
  end;

  Handled := (IsDialogMessage(WebBrowser1.Handle, Msg) = System.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 DialogKeys) then
        // nothing - do not pass on the DialogKeys
      else
        FOleInPlaceActiveObject.TranslateAccelerator(Msg);
  end;
end;

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

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

initialization
  OleInitialize(nil);

finalization
  OleUninitialize;

end.
so und er markiert mir die oben angegebene zeile (siehe die antwort von mir weiter oben) rot .
  Mit Zitat antworten Zitat