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.