class Wnd
{
HWND hWnd;
HFONT hFont;
LOGFONT LogFont;
public:
void ChangeFont(const LOGFONT& lf)
{
memcpy(&LogFont,&lf,sizeof(LOGFONT));
if(hFont) DeleteObject(hFont);
hFont = CreateFontIndirect (&LogFont);
SendMessage(hWnd,WM_SETFONT,(WPARAM)(hFont?hFont:GetStockObject(ANSI_VAR_FONT),(LPARAM)1);
}
Wnd()
{
hWnd = 0;
hFont = 0;
}
~Wnd()
{
if(hFont) DeleteObject(hFont);
}
};
That looks better, Regards.