Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
window and text
#6
Code:
Copy      Help
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:
Code:
Copy      Help
;/
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)


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)