Tamto rozwiazanie po mojemu jak do tego celu to zdecydowanie przekombinowane:
const
WM_ONHINT = WM_USER + 1000;
type
THintWindow = class(Controls.THintWindow)
private
procedure WMShowWindow(var Msg: TMessage); message WM_SHOWWINDOW;
public
procedure ActivateHint(Rect: TRect; const AHint: string); override;
end;
TForm1 = class(TForm)
Label1: TLabel;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
procedure WMOnHint(var Msg: TMessage); message WM_ONHINT;
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure THintWindow.WMShowWindow(var Msg: TMessage);
begin
inherited;
SendMessage(Application.MainForm.Handle, WM_ONHINT, 0, 0); //wParam = 0 - Hide
end;
procedure THintWindow.ActivateHint(Rect: TRect; const AHint: string);
begin
inherited;
SendMessage(Application.MainForm.Handle, WM_ONHINT, 1, 0); //wParam = 1 - Show
end;
procedure TForm1.WMOnHint(var Msg: TMessage);
begin
if Msg.WParam = 0 then
Caption:= 'Hide Hint'
else
Caption:= 'Show Hint';
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
HintWindowClass:= THintWindow;
end;