⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 unit1.pas

📁 《Delphi7编程100例》代码,书配资料
💻 PAS
字号:
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.
 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -