When i run the code for tut 5, the amount of gdi memory i have left starts go down rather quickly. It happens whenever you resize the window. Is this supposed to happen?
Someone told me it's a "feature" of Windows itself. Try other prog and see if the same thing happens when you resize the window.
I made just a basic window that doesnt do any painting, and it doesnt have this problem.
This could be wrong, but...
invoke CreateFont, (lots of params)
invoke SelectObject, hdc, eax
mov hfont,eax
...
invoke TextOut,hdc,0,0,ADDR TestString,SIZEOF TestString
invoke SelectObject,hdc, hfont
invoke EndPaint,hWnd, ADDR ps
Maybe you forgot invoke DeleteObject, eax between the SelectObject and EndPaint?
invoke CreateFont, (lots of params)
invoke SelectObject, hdc, eax
mov hfont,eax
...
invoke TextOut,hdc,0,0,ADDR TestString,SIZEOF TestString
invoke SelectObject,hdc, hfont
invoke EndPaint,hWnd, ADDR ps
Maybe you forgot invoke DeleteObject, eax between the SelectObject and EndPaint?
Heh, Irwing beat me to it (I'm excused, I was watching evangelion).
Yes, it indeed looks like the problem is not deleting the font after
use. Also, wouldn't it be better to create the font only on WM_CREATE,
and delete it on WM_DESTROY ?
Yes, it indeed looks like the problem is not deleting the font after
use. Also, wouldn't it be better to create the font only on WM_CREATE,
and delete it on WM_DESTROY ?