unit1.pas

来自「Delphi高级界面特效制作百例源代码,这是随书源代码部分,不知可否」· PAS 代码 · 共 61 行

PAS
61
字号
unit Unit1;

// This little example shows how to create the illusion
// of your program painting directly on the desktop!
// If you have any ideas for improvements, please send
// the new version to me - you will ofcourse be credited.
// Particularly I'm looking for methods to make the
// drawing faster, although it's not HORRIBLY slow now.
//
// Note that: the illusion is lost if something changes
// underneath your form - this means that this effects
// is probably only useful for splash screens etc.
// If you can figure out how to make the image repaint
// when something changes underneath it, please write!
// Also note that I'm assuming the client area of the
// form is exactly the same size as the map and mask
// images.
//
// You can e-mail me at mus303@yahoo.com

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, ExtCtrls;

type
  TForm1 = class(TForm)
    Label1: TLabel;
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
    procedure WMNCHitTest(var M: TWMNCHitTest);
    message wm_NCHitTest;
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}
procedure TForm1.WMNCHitTest(var M: TWMNCHitTest);
begin
  inherited;                    { call the inherited message handler }
  if  M.Result = htClient then  { is the click in the client area?   }
      M.Result := htCaption;    { if so, make Windows think it's     }
                                { on the caption bar.                }
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
     Brush.Style:=bsClear;
end;


end.

⌨️ 快捷键说明

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