I am currently using the function SystemParametersInfo to retrieve SPI_GETICONTITLELOGFONT. According to the MSDN documentation this is the http://msdn.microsoft.com/en-us/library/ms724947(VS.85).aspx
"Retrieves the logical font information for the current icon-title font"
But this always retrieves 'Segoe UI' even when I change my font to 'VivlaidD'. I am on a Windows 7 machine. Is it that this function only retrieves the system default? Or is there something wrong with 'SystemParametersInfo'?
Here is my code for retrieving the font:
procedure GetUserFontPreference(out FaceName: string; out PixelHeight: Integer);
var
lf: LOGFONT;
begin
ZeroMemory(@lf, SizeOf(lf));
if SystemParametersInfo(SPI_GETICONTITLELOGFONT, SizeOf(lf), @lf, 0) then
begin
FaceName := PChar(Addr(lf.lfFaceName[0]));
PixelHeight := lf.lfHeight;
end
else
begin
{
If we can't get it, then assume the same non-user preferences that
everyone else does.
}
FaceName := 'MS Shell Dlg 2';
PixelHeight := 8;
end;
end;