Einzelnen Beitrag anzeigen

sahmann

Registriert seit: 21. Jan 2003
15 Beiträge
 
#9

Re: TMediaPlayer (SDK 6.4) Videofenster bewegen? (ohne Rahme

  Alt 28. Sep 2003, 23:29
So, Problem geloest.

Und zwar habe ich es nun folgendermassen gemacht:

Delphi-Quellcode:
unit U_PlayerForm;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, OleCtrls, WMPLib_TLB, MediaPlayer_TLB;

type
  TPlayer = class(TForm)
    MediaPlayer: TOMediaPlayer;
    procedure FormCreate(Sender: TObject);
    procedure MediaPlayerMouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Player: TPlayer;

implementation

uses U_Player;

{$R *.dfm}

procedure TPlayer.FormCreate(Sender: TObject);
var
 OldStyle: longint;
begin
 inherited;
 ShowWindow(Self.Handle,SW_HIDE);
 SystemParametersInfo(SPI_SETDRAGFULLWINDOWS, 1, nil, 0);
 OldStyle := GetWindowLong(Handle, GWL_STYLE);
 SetWindowLong(Handle, GWL_STYLE, OldStyle and not WS_CAPTION);
 Width := MediaPlayer.Width;
 Height := MediaPlayer.Height;
 MediaPlayer.DragMode := dmManual;
end;

procedure TPlayer.MediaPlayerMouseDown(Sender: TObject;
  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
var
 i: Integer;
begin
  if Button = mbLeft then begin
   ReleaseCapture;
   SendMessage(Handle, WM_SYSCOMMAND, 61458, 0);
  end;
end;

end.
Besten Dank fuer die Tips,
Sascha :)

[edit=Christian Seehase] BBCode wieder aktiviert. Mfg, Christian Seehase[/edit]
  Mit Zitat antworten Zitat