I created a script which uses a GUI, but I had a problem: if the user had the "Large Fonts" set in the Display settings, the GUI would present truncations all around.
Although AHK allows for auto-resize and auto-placement of GUI controls, I wanted to have full control of their exact position in the GUI.
After unsuccessful and/or confusing google searches, I found out that the actual font size is specified in a registry key:
HKEY_CURRENT_USER\Control Panel\Desktop\WindowMetrics\AppliedDPIso I created a tiny function which returns 0 is the user is using normal (default) font size or 1 if the user is using large font size:
if checkDPIsize()=0 msgbox, You are using normal font settings else msgbox, You are using LARGE font settings exitapp ; This is the function: ; returns 0 if normal font size or 1 if LARGE font size checkDPIsize() { RegRead, DPI_value, HKEY_CURRENT_USER, Control Panel\Desktop\WindowMetrics, AppliedDPI if errorlevel=1 ; the reg key was not found - it means default settings return 0 if DPI_value=96 ; 96 is the default font size setting return 0 if DPI_value>96 ; A higher value should mean LARGE font size setting return 1 }Note that if the registry key does not exist, it means that the deaulft settings are being used.
By knowing whether the user is using normal or large fonts, I can act accordingly in the GUI definition section...
This works in Win2000 & WinXP, I don't know about earlier versions...
I though that it might be worth sharing, in case other AHKers were facing the same problem...
jordi