WM_SETFONT Message--------------------------------------------------------------------------------An application sends a WM_SETFONT message to specify the font that a control is to use when drawing text. Syntax To send this message, call the SendMessage function as follows. lResult = SendMessage( // returns LRESULT in lResult (HWND) hWndControl, // handle to destination control (UINT) WM_SETFONT, // message ID (WPARAM) wParam, // = (WPARAM) () wParam; (LPARAM) lParam // = (LPARAM) () lParam; ); ParameterswParam Handle to the font. If this parameter is NULL, the control uses the default system font to draw text. lParam The low-order word of lParam specifies whether the control should be redrawn immediately upon setting the font. If this parameter is TRUE, the control redraws itself. Return ValueThis message does not return a value.
CWnd* pWnd=GetDlgItem(IDOK);
pWnd->SetFont(&m_fntOK);
CFont m_fntOK;上边的代码在DL::OnInitDialog里
生存的周期不要过了。
我不会C++啊!
To send this message, call the SendMessage function as follows.
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) WM_SETFONT, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam; );
ParameterswParam
Handle to the font. If this parameter is NULL, the control uses the default system font to draw text.
lParam
The low-order word of lParam specifies whether the control should be redrawn immediately upon setting the font. If this parameter is TRUE, the control redraws itself.
Return ValueThis message does not return a value.