Implement this:
bool CALLBACK SetFont(HWND child, LPARAM font){
SendMessage(child, WM_SETFONT, font, true);
return true;
}
inside a separate file or just in the main.cpp and then just run:
EnumChildWindows(hwnd, (WNDENUMPROC)SetFont, (LPARAM)GetStockObject(DEFAULT_GUI_FONT));
whenever you want, for example in the WM_CREATE
message, after you've created all your child windows!
I always have a SetFont.cpp
and a SetFont.h
in my win32 GUI application solutions.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…