This material does provide the answer. However I thought that a very simple piece of sample code would help others understand how to change a default font on a control.
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
{
hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
120, 40, 400, 400, NULL, NULL, hInstance, NULL);
if (!hWnd)
{
return FALSE;
}
// Set the font for all buttons etc:
hFont=CreateFont (14, 0, 0, 0, FW_DONTCARE, FALSE, FALSE, FALSE, ANSI_CHARSET, \
OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, \
DEFAULT_PITCH | FF_SWISS, L"Arial");
// Create our control:
hBtnButton1 = CreateWindow (L"BUTTON", L"Button1", \
WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON | BS_CENTER, \
10, 10, 50, 25, hWnd, (HMENU) IDR_BUTTON1, hInst, NULL);
if (hBtnButton1 == NULL)
{
MessageBox (hWnd, L"hBtnButton1 not created", L"Create hBtnButton1", IDOK);
}
// Set the new font for the control:
SendMessage (hBtnButton1, WM_SETFONT, WPARAM (hFont), TRUE);
ShowWindow(hWnd, nCmdShow);
UpdateWindow(hWnd);
return TRUE;
}
Kenneth Spencer