...
SetTooltipFont(tooltipID, "s24 , Arial") ; set the tooltip text font
...
SetTooltipFont(pTooltipID, pFont="") {
local height, weight, italic, underline, strikeout , nCharSet
local hFont
static WM_SETFONT := 0x30
;parse font
italic := InStr(pFont, "italic") ? 1 : 0
underline := InStr(pFont, "underline") ? 1 : 0
strikeout := InStr(pFont, "strikeout") ? 1 : 0
weight := InStr(pFont, "bold") ? 700 : 400
;height
RegExMatch(pFont, "(?<=[S|s])(\d{1,2})(?=[ ,])", height)
if (height = "")
height := 10
RegRead, LogPixels, HKEY_LOCAL_MACHINE, SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontDPI, LogPixels
height := -DllCall("MulDiv", "int", Height, "int", LogPixels, "int", 72)
;face
RegExMatch(pFont, "(?<=,).+", fontFace)
if (fontFace != "")
fontFace := RegExReplace( fontFace, "(^\s*)|(\s*$)") ;trim
else fontFace := "MS Sans Serif"
;create font
hFont := DllCall("CreateFont", "int", height, "int", 0, "int", 0, "int", 0
,"int", weight, "Uint", italic, "Uint", underline
,"Uint", strikeOut, "Uint", nCharSet, "Uint", 0, "Uint", 0, "Uint", 0, "Uint", 0, "str", fontFace)
SendMessage,WM_SETFONT,hFont,TRUE, , ahk_id %pTooltipID%
return ErrorLevel
}
Any advice is much appreciated!





