I am trying to set the faunt for the buttons and labels on the scrren. I am using CreateWindow and using CreateWindow for buttons.
SelectObject(GetDC(hwnd),(HFONT) GetStockObject(ANSI_VAR_FONT));
How can I get the FONT to set and stay set????
I am trying to set the faunt for the buttons and labels on the scrren. I am using CreateWindow and using CreateWindow for buttons.
SelectObject(GetDC(hwnd),(HFONT) GetStockObject(ANSI_VAR_FONT));
How can I get the FONT to set and stay set????
Use SendMessage to send a WM_SETFONT for each control. If you've got a lot of controls and the font is the same for each one, an EnumChildProc is useful:and invoke it with EnumChildWindows from, for example, the parent's WM_CREATE handler:Code:BOOL CALLBACK SetChildFonts(HWND hControl,LPARAM lParam) { SendMessage(hControl,WM_SETFONT,lParam,MAKELPARAM(1,0)); }Code:case WM_CREATE: { EnumChildWindows(hwnd,SetChildFonts, (LPARAM)GetStockObject(ANSI_VAR_FONT)); }
CProgramming FAQ
Caution: this person may be a carrier of the misinformation virus.