I want all the controls (edit,list control, etc) in my application to be having the same font which is not the system default. How do i do this? Is there any Win32 API that sets the application default font?
See Question&Answers more detail:osI want all the controls (edit,list control, etc) in my application to be having the same font which is not the system default. How do i do this? Is there any Win32 API that sets the application default font?
See Question&Answers more detail:osImplement 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.