unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 =
class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
private
{ Private-Deklarationen }
HintWnd: THintWindow;
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
MPos: TPoint;
begin
GetCursorPos(MPos);
HintWnd.ActivateHint(Rect(MPos.X, MPos.Y, MPos.X + 100, Mpos.Y + 15), '
Hallo Welt!');
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
HintWnd := THintWindow.Create(Self);
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
HintWnd.Free;
end;