06-29-2004, 05:44 PM
int hwnd=id(2201 _hwndqm)
int+ g_hfont g_hfontprev
if(!g_hfontprev) g_hfontprev=SendMessage(hwnd WM_GETFONT 0 0)
if(!g_hfont) g_hfont=CreateFont2("Verdana" 15 700)
SendMessage(hwnd WM_SETFONT g_hfont 1)
5
SendMessage(hwnd WM_SETFONT g_hfontprev 1)Function CreateFont2:
;/
function $font [size] [weight] ;;weight: 400 is normal
dll gdi32 #GetObject hgdiobj cbBuffer !*lpvObject
def SYSTEM_FONT 13
LOGFONT lf
GetObject(GetStockObject(SYSTEM_FONT) sizeof(LOGFONT) &lf)
lf.lfPitchAndFamily=0
lf.lfWidth=0
if(size) lf.lfHeight=-MulDiv(size GetDeviceCaps(GetDC(0) LOGPIXELSY) 72)
else lf.lfHeight=0
lf.lfWeight=weight
strncpy(&lf.lfFaceName font 31)
ret CreateFontIndirect(&lf)