CreateFont would ideally be placed in some other part of the program, at startup, initialization routine etc, where the font handle is saved.
invoke CreateFont,16,0,0,0,400,0,0,0,OEM_CHARSET,\
OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,\
DEFAULT_QUALITY,DEFAULT_PITCH or FF_SCRIPT,\
ADDR FontName
mov hfont,eax
Can be moved to WM_INITDIALOG or something else.
The old font object is probably still being leaked when selecting and clearing it i suspect. I would have an hOldFont handle when using the SelectObject and restore once finished with it.
Something like:
Invoke SelectObject, hdc, hFont
mov hOldFont, eax
.
.
. do some stuff with text and font
.
.
.
Invoke SelectObject, hdc, hOldFont
Of course there could be a resource leak elsewhere or something else ive forgotten.