Einzelnen Beitrag anzeigen

greenmile

Registriert seit: 17. Apr 2003
1.107 Beiträge
 
Delphi 10.3 Rio
 
#5

AW: Rechtsklick in Flashplayer abfangen

  Alt 9. Sep 2010, 10:34
Wow, das funktioniert erste Sahne, vielen Dank. Für die Nachwelt hier der Source:


Code:
Application.OnMessage := NoFlashRightClick;
Code:
procedure TfrmMain.NoFlashRightClick(var Msg: TMsg; var Handled: Boolean);

  Function CursorInPlayerWindow: Boolean;
    var cPos, playerPos: TPoint;
  begin
    GetCursorPos(cPos);
    playerPos := Player.ClientToScreen(point(0,0));
    Result := (cPos.x>playerPos.x) and (cPos.y>playerPos.y) and (cPos.x<(playerPos.x+Player.Width)) and (cPos.y<(playerPos.y+Player.Height)));
  end;

begin
  Handled := false;

  If ((Msg.message = WM_RBUTTONDOWN) and (Msg.wParam = MK_RBUTTON)) then begin
    If CursorInPlayerWindow then Handled := True;
    // Hier ggf eigenes Menü "aufpoppen" lassen
  End Else If ((Msg.message = WM_LBUTTONDOWN) and (Msg.wParam = MK_LBUTTON)) then begin
    If CursorInPlayerWindow then Handled := True;
  End Else If ((Msg.message = WM_RBUTTONDBLCLK) or (Msg.message = WM_LBUTTONDBLCLK)) then begin
    If CursorInPlayerWindow then Handled := True;
  End;
end;
  Mit Zitat antworten Zitat