Ok, i found out why it didn´t worked before with CreateFont
I did the same thing as in RTF font structure. The probelm is that when seting fonts to a RTF control, i can delete the font object on the same routne, i mean, i don´t need to deletet it after WM_CLOSe is clicked.
But, for other controls, i can´t use deleteobject on the same routine. The fonts for the controls must be deleted when the user closes the App.
I´ll try to make a routine for common controls that can set the color, font, and background of the controls on the sam way s i did for the RTF, with the difference that the user must delete the object once his app is closed.
Ill give a try.
And probably my function SetRTFFont works for both EditControls and RTF controls as well.I´ll test SetRTFFont on a regular editcontrol to see if it works the same way as in RTF