unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TForm1 = class(TForm)
Label1: TLabel;
procedure Label1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
uses
MmSystem;
type
PtsType = array [0..15, 0..1] of Integer;
const
Pts: PtsType = ((0, 0), (800, 0), (800, 600),
(200, 600), (200, 220), (300, 280),
(265, 205), (350, 117), (205, 170),
(120, 90), (130, 200), (60, 350), (200, 220),
(200, 600), (0, 600), (0, 0));
procedure TForm1.Label1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
var
HRegion1: THandle;
begin
HRegion1 := CreatePolygonRgn (Pts,
sizeof (Pts) div 8, alternate);
PlaySound ('boom.wav', 0, snd_async);
SetWindowRgn (Handle, HRegion1, True);
end;
end.