unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, OleCtrls, ShockwaveFlashObjects_TLB,
ActiveX, StdCtrls;
type
TForm1 = class(TForm)
ShockwaveFlash1: TShockwaveFlash;
procedure FormCreate(Sender: TObject);
private
{ Private-Deklarationen }
FOleInPlaceActiveObject: IOleInPlaceActiveObject;
procedure MsgHandler(var Msg: TMsg; var Handled: Boolean);
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
Application.OnMessage := MsgHandler;
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, $43, $56];
DialogKeys: set of Byte = [$43, $56];
var
iOIPAO: IOleInPlaceActiveObject;
Dispatch: IDispatch;
begin
if (ShockwaveFlash1 = nil) then
begin
Handled := System.False;
Exit;
end;
if ((Msg.message = WM_KEYDOWN) or (Msg.message = WM_KEYUP)) then begin
if (Msg.wParam in DialogKeys) then begin
// Handled := (IsDialogMessage(ShockwaveFlash1.Handle, Msg) = System.true);
Handled := System.true;
if FOleInPlaceActiveObject = nil then begin
Dispatch := ShockwaveFlash1.DefaultDispatch;
if Dispatch <> nil then begin
Dispatch.QueryInterface(IOleInPlaceActiveObject, iOIPAO);
if iOIPAO <> nil then
FOleInPlaceActiveObject := iOIPAO;
end;
end;
FOleInPlaceActiveObject.TranslateAccelerator(Msg);
end;
end;
end;
initialization
OleInitialize(nil);
finalization
OleUninitialize;
end.