unit1.~pas
来自「精彩编程百例26~50 其中有 控制任务栏 windows底层任务控制 屏保预览」· ~PAS 代码 · 共 54 行
~PAS
54 行
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), (600, 0), (600, 600),
(200, 600), (200, 220), (300, 280),
(265, 205), (350, 147), (205, 170),
(120, 90), (130, 200), (40, 350), (200, 220),
(200, 700), (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 ('voice.wav', 0, snd_async);
SetWindowRgn (Handle, HRegion1, True);
end;
end.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?