After I use setcontrolfont, the text of the text field does not update. The onnly way I fixed this is by removing then readding all text but this seems hackish. How can I do it properly?
Thanks
*its a function I made:
void SetControlFont(HWND hand, int size, char* name)
{
HGDIOBJ hfDefault;
hfDefault = (HGDIOBJ)CreateFontA(size, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0,name);
SendMessage(hand, WM_SETFONT, (WPARAM)hfDefault, MAKELPARAM(FALSE, 0));
}
The
MAKELPARAM(FALSE, 0)is telling the window that it should not redraw itself. Have you tried usingMAKELPARAM(TRUE, 0)instead?If you do not want to change the
SetControlFontfunction, you could tell the text field to redraw itself after callingSetControlFontby callingRedrawWindow.