unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, System.ComponentModel, Borland.Vcl.StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    Button4: TButton;
    procedure Button4Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.nfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
SendMessage(FindWindow('Winamp v1.x',nil),WM_COMMAND,40045,0); //Odtwarzaj
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
SendMessage(FindWindow('Winamp v1.x',nil),WM_COMMAND,40046,0); //Pauza
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
SendMessage(FindWindow('Winamp v1.x',nil),WM_COMMAND,40047,0); //Zatrzymaj
end;

procedure TForm1.Button4Click(Sender: TObject);
begin
SendMessage(FindWindow('Winamp v1.x',nil),WM_COMMAND,40048,0); //Następny utwór
end;

end.
