if (ChooseFont(&chFont)) {
HWND childWnd;
+ HFONT hFontOld;
+ DeleteObject(Globals.hfont);
Globals.hfont = CreateFontIndirect(&lFont);
- SelectFont(hdc, Globals.hfont);
+ hFontOld = SelectFont(hdc, Globals.hfont);
GetTextExtentPoint32(hdc, sSpace, 1, &Globals.spaceSize);
/* change font in all open child windows */
InvalidateRect(child->left.hwnd, NULL, TRUE);
InvalidateRect(child->right.hwnd, NULL, TRUE);
}
+
+ SelectFont(hdc, hFontOld);
}
else if (CommDlgExtendedError()) {
LoadString(Globals.hInstance, IDS_FONT_SEL_DLG_NAME, dlg_name, BUFFER_LEN);
CoUninitialize();
#endif
+ DeleteObject(Globals.hfont);
ImageList_Destroy(Globals.himl);
}