procedure ShowBalloonTip(Control: TWinControl; Icon: integer; Title: pchar; Text:
PChar);
var
hWnd: THandle;
hWndTip: THandle;
ti: TOOLINFO;
pt: Tpoint;
begin
hWnd := Control.Handle;
hWndTip := CreateWindow(TOOLTIPS_CLASS, nil,
WS_POPUP or TTS_NOPREFIX or TTS_BALLOON or TTS_ALWAYSTIP,
0, 0, 0, 0, hWnd, 0, HInstance, nil);
if hWndTip <> 0 then
begin
SetWindowPos(hWndTip, HWND_TOPMOST, 0, 0, 0, 0,
SWP_NOACTIVATE or SWP_NOMOVE or SWP_NOSIZE);
ti.cbSize := SizeOf(ti);
ti.uFlags := {TTF_CENTERTIP or} TTF_TRANSPARENT or TTF_SUBCLASS;
ti.hwnd := hWnd;
ti.lpszText := Text;
Windows.GetClientRect(hWnd, ti.rect);
SendMessage(hWndTip, TTM_ADDTOOL, 1, integer(@ti));
pt:=point(10, 10);
// sendmessage(hWndTip, TTM_WINDOWFROMPOINT, 0, integer(MAKELPARAM(pt.X, pt.Y)));
SendMessage(hWndTip, TTM_SETTITLE, Icon mod 4, Integer(Title));
// setWindowpos(hWndTip, HWND_TOPMOST, 1, 1, 0, 0, SWP_NOSIZE or SWP_NOACTIVATE);
end;
end;