unit FMX.Controls.Win;
const
TOOLTIPS_CLASS = '
tooltips_class32';
constructor TWindowsHint.Create(
const AHandle: TWindowHandle);
var
LToolInfo: TOOLINFO;
begin
inherited;
FWindowHandle := AHandle;
FNativeControlHandle := WindowHandleToPlatform(AHandle).Wnd;
if FNativeControlHandle <> 0
then
begin
FToolTipHandle := CreateWindowEx(0, TOOLTIPS_CLASS,
nil, WS_POPUP
or TTS_ALWAYSTIP, 0, 0, 300, 300,
FNativeControlHandle, 0, hInstance,
nil);
SetWindowPos(FToolTipHandle, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE
or SWP_NOSIZE
or SWP_NOACTIVATE);
FillChar(LToolInfo, SizeOf(TOOLINFO), 0);
LToolInfo.cbSize := SizeOf(TOOLINFO);
LToolInfo.uFlags := TTF_SUBCLASS
or TTF_IDISHWND
or TTF_PARSELINKS;
LToolInfo.hinst := hInstance;
LToolInfo.hwnd := FNativeControlHandle;
LToolInfo.uId := FNativeControlHandle;
LToolInfo.lpszText :=
nil;
SendMessage(FToolTipHandle, TTM_ADDTOOL, 0, LPARAM(@LToolInfo));
SendMessage(FToolTipHandle, TTM_ACTIVATE, NativeInt(False), LPARAM(@LToolInfo));
end;
end;