It was a little more difficult than I figured, but something like this will get you the font name and size (in points)
; Desktop Icon Info Example by soja
; .lib "user32.dll"
; SystemParametersInfo%(uiAction%, uiParam%, pvParam*, fWinIni%):"SystemParametersInfoA"
; GetDC%(hwnd%):"GetDC"
;
; .lib "gdi32.dll"
; GetDeviceCaps%(hdc%, nIndex%):"GetDeviceCaps"
;
; Look up "SystemParametersInfo" on msdn.microsoft.com for more info.
Const SPI_GETICONTITLELOGFONT = $001F
Const LOGPIXELSY = 90 ; Logical vertical pixels per inch
LOGFONT = CreateBank(40)
SystemParametersInfo(SPI_GETICONTITLELOGFONT, BankSize(LOGFONT), LOGFONT, 0)
Print "Desktop Icon Information"
f$ = "Face: "
a = 28
While PeekByte(LOGFONT, a) <> 0
f$=f$+Chr$(PeekByte(LOGFONT, a))
a=a+1
Wend
Print f$
Print "Height in Points: "+ (-72 * PeekInt(LOGFONT, 0)) / GetDeviceCaps(GetDC(0), LOGPIXELSY)
WaitKey
|