Mega Code Archive

 
Categories / Delphi / System
 

Checking for Large fonts in windows

Title: Checking for Large fonts in windows Question: How do I tell if someone is using Large fonts in windows Answer: ADDITION 2/12/2000: See Erik's comment below for a simpler method. This is needed, since your form may need to cater for different sized title bars etc. Here's what you do: function GotSmallFonts: boolean; var fontsize : integer; hdc : Thandle; begin result := false; hdc := GetDc(hwnd_desktop); fontsize := GetDeviceCaps(hdc,logpixelsx); ReleaseDc(hwnd_desktop,hdc); if fontsize = 96 then result := true else result := false; end; 96 is the default. Tested with D5 and w2k/98/95/nt4. Should work fine with other delphi versions.