case uMsg of
WM_MOUSELEAVE:
if WindowHover then
begin
// reset state
WindowHover := False;
// create and set font
[color=red]LinkFontHover := CreateFont(-MulDiv(LINKFONTSIZE, GetDeviceCaps(GetDC(hLinkStc), LOGPIXELSY), 72), 0, 0, 0, 400,
0, 0, 0, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH, LINKFONTNAME);[/color]
if LinkFontHover <> 0 then
begin
// save
handle as a window property
[color=red]SetProp(hLinkStc, 'LinkFontHover', LinkFontHover);
SendMessage(hLinkStc, WM_SETFONT, Integer(LinkFontHover), Integer(true));[/color]
end;
end;
WM_MOUSEMOVE:
if not WindowHover then
begin
// save state
WindowHover := True;
// create and set font
[color=red]LinkFontNonHover := CreateFont(-MulDiv(LINKFONTSIZE, GetDeviceCaps(GetDC(hLinkStc), LOGPIXELSY), 72), 0, 0, 0,
400, 0, 1, 0, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH,
LINKFONTNAME);[/color]
if LinkFontNonHover <> 0 then
begin
// save the
handle as a window property
[color=red]SetProp(hLinkStc, 'LinkFontNonHover', LinkFontNonHover);
SendMessage(hLinkStc, WM_SETFONT, Integer(LinkFontNonHover), Integer(true));[/color]
end;
// track WM_MOUSELEAVE
EventTrack.cbSize := SizeOf(EventTrack);
EventTrack.dwFlags := TME_LEAVE;
EventTrack.hwndTrack := hLinkStc;
EventTrack.dwHoverTime := HOVER_DEFAULT;
TrackMouseEvent(EventTrack);
end;