Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi Problem TWebbrowser und Java-Applett Cursor, Tab,... (https://www.delphipraxis.net/21281-problem-twebbrowser-und-java-applett-cursor-tab.html)

coolpixel 30. Apr 2004 10:15


Problem TWebbrowser und Java-Applett Cursor, Tab,...
 
Hallo,
ich bin Newbie und habe nun folgendes Problem:
Ich habe eine Internet Seite mit einem integrierten Java-Applett. In diesem Aplett benötige ich die Cursor-Tasten... aber wenn ich per sendkey oder per manuellem Tastendruck Eingaben versuche, nimmt der TWebbrowser nur normale Zeichen an.... Kein TAB, Cursor up + down, Backspace,....


habe diesen Code probiert, der hilft nur Backspace-Taste zu akzeptieren...
Delphi-Quellcode:
procedure TForm1.MsgHandler(var Msg: TMsg; var Handled: Boolean);
const
  DialogKeys: set of Byte = [VK_LCONTROL,ord('j'),VK_LEFT, VK_RIGHT, VK_BACK,VK_UP,VK_DOWN,65, $30..$39, $41..$5A];
var
  iOIPAO: IOleInPlaceActiveObject;
  Dispatch: IDispatch;
begin
  { exit if we don't get back a webbrowser object } 
  if (Webb = nil) then
  begin
    Handled := System.False;
    Exit;
  end;
  Dispatch := Webb.Application;
  Handled := (IsDialogMessage(Webb.Handle, Msg) = System.True);
  if (Handled) then
  begin
      //Dispatch := Webb.Application;
      Dispatch.QueryInterface(IOleInPlaceActiveObject, iOIPAO);
      FOleInPlaceActiveObject := iOIPAO;
    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);

      if (Msg.wParam = 8) or (Msg.wParam = 39) or (Msg.wParam = 37) or (Msg.wParam = 38) or
          (Msg.wParam = 39) or (Msg.wParam = 9) or (Msg.wParam = 40) then
          begin
            exit;
          end
          else
            if ((Msg.message = WM_KEYDOWN) or (Msg.message = WM_KEYUP)) then
              Application.ProcessMessages;
              FOleInPlaceActiveObject.TranslateAccelerator(Msg);
 
  end;
end;


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

initialization
  OleInitialize(nil);

finalization
  OleUninitialize;

end.
Hat jemand evtl. eine lösung für Cursor up and down und Tab ??? Auch bei Sendkeys ??

Gruß

coolpixel[delphi]


Alle Zeitangaben in WEZ +1. Es ist jetzt 08:29 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz