:
This message was edited by AsmGuru62 at 2005-10-25 4:0:27
: :
: : Hi,
: :
: : I have trouble with CreateIndirectFont(). When I run my program for a while the font size automatically change. Why could this happen?
: : Here is part of my code.
: :
: : case WM_PAINT:
: : ...
: : hDC = BeginPaint ( hWnd, &ps);
: :
: : lf.lfWeight= FW_NORMAL;
: : lf.lfCharSet= ANSI_CHARSET;
: : lf.lfPitchAndFamily=35;
: : lf.lfHeight= 10;
: : strcpy(lf.lfFaceName, "Tahoma"); // why not specifying the name?
: :
: : hNFont=CreateFontIndirect(&lf);
: : hDefault=SelectObject(hDC,hNFont);
: :
: : TextOut(hDC...
: : SelectObject(hDC,hDefault);
: : DeleteObject(hNFont);
: : ...
: : ....
: :
: : EndPaint(hWnd,&ps);
: :
: : break;
: :
: :
Hi,
Thanks for your reply.
Would you please, explain more detail why do I have to add a few more line? I just made copy&paste&modify from my Windows programming book.
My best,
Teerapong