That function is good to extract the font of a control (e.g. with the default font set). But together with Melba23 I even took it a step further . The GetDefaultThemeFont() is used in his excellent #include <array.au3>
Global $aFontData = _GetDefaultThemeFont()
_ArrayDisplay($aFontData)
; #INTERNAL_USE_ONLY#============================================================================================================
; Name...........: _GetDefaultThemeFont
; Description ...: Determines Windows default MsgBox font size and name
; Syntax.........: _GetDefaultThemeFont()
; Return values .: Success - Array holding determined font data
; : Failure - Array holding default values
; Array elements - [0] = Size, [1] = Weight, [2] = Style, [3] = Name, [4] = Quality
; Author ........: KaFu, Melba23
; Remarks .......: Used internally by ExtMsgBox UDF
; ===============================================================================================================================
Func _GetDefaultThemeFont()
; Fill array with standard default data
Local $aDefFontData[5] = [9, 400, 0, "Tahoma", 2]
; Get AutoIt GUI handle
Local $hWnd = WinGetHandle(AutoItWinGetTitle())
; Open Theme DLL
Local $hThemeDLL = DllOpen("uxtheme.dll")
; Get default theme handle
Local $hTheme = DllCall($hThemeDLL, 'ptr', 'OpenThemeData', 'hwnd', $hWnd, 'wstr', "Static")
If @error Then Return $aDefFontData
$hTheme = $hTheme[0]
; Create LOGFONT structure
Local Const $LOGFONT = _
'LONG lfHeight;' & _
'LONG lfWidth;' & _
'LONG lfEscapement;' & _
'LONG lfOrientation;' & _
'LONG lfWeight;' & _
'BYTE lfItalic;' & _
'BYTE lfUnderline;' & _
'BYTE lfStrikeOut;' & _
'BYTE lfCharSet;' & _
'BYTE lfOutPrecision;' & _
'BYTE lfClipPrecision;' & _
'BYTE lfQuality;' & _
'BYTE lfPitchAndFamily;' & _
'WCHAR lfFaceName [32];'
Local $tFont = DllStructCreate($LOGFONT)
Local $pFont = DllStructGetPtr($tFont)
; Get MsgBox font from theme
DllCall($hThemeDLL, 'long', 'GetThemeSysFont', 'HANDLE', $hTheme, 'int', 805, 'ptr', $pFont) ; TMT_MSGBOXFONT
If @error Then Return $aDefFontData
; Get default DC
Local $hDC = DllCall("user32.dll", "handle", "GetDC", "hwnd", $hWnd)
If @error Then Return $aDefFontData
$hDC = $hDC[0]
; Get font vertical size
Local $iPixel_Y = DllCall("gdi32.dll", "int", "GetDeviceCaps", "handle", $hDC, "int", 90) ; LOGPIXELSY
If Not @error Then
$iPixel_Y = $iPixel_Y[0]
; Calculate point size
$aDefFontData[0] = -Round(((1 * DllStructGetData($tFont, 1)) * 72 / $iPixel_Y), 1)
EndIf
; Close DC
DllCall("user32.dll", "int", "ReleaseDC", "hwnd", $hWnd, "handle", $hDC)
; Extract font data from LOGFONT structure
$aDefFontData[1] = DllStructGetData($tFont, 'lfWeight')
$aDefFontData[2] = 2 * (True = DllStructGetData($tFont, 'lfItalic')) + 4 * (True = DllStructGetData($tFont, 'lfUnderline')) + 8 * (True = DllStructGetData($tFont, 'lfStrikeOut'))
$aDefFontData[3] = DllStructGetData($tFont, 'lfFaceName')
$aDefFontData[4] = DllStructGetData($tFont, 'lfQuality')
Return $aDefFontData
EndFunc ;==>_GetDefaultThemeFont