diff options
| author | Pietro Gagliardi <[email protected]> | 2014-07-18 11:20:18 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-07-18 11:20:18 -0400 |
| commit | f64f2781ce07d140ef450c6c56777da8728dc612 (patch) | |
| tree | 70b8233455aa468c578c2af199b976e70bd52f22 /redo/init_windows.c | |
| parent | 489ce0a0538c81ab6a10efd4b97cce6299fc4d81 (diff) | |
Added (and applied) standard Windows fonts.
Diffstat (limited to 'redo/init_windows.c')
| -rw-r--r-- | redo/init_windows.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/redo/init_windows.c b/redo/init_windows.c index d3771e0..343b9d4 100644 --- a/redo/init_windows.c +++ b/redo/init_windows.c @@ -8,9 +8,16 @@ int nCmdShow; HICON hDefaultIcon; HCURSOR hArrowCursor; +HFONT controlFont; +HFONT titleFont; +HFONT smallTitleFont; +HFONT menubarFont; +HFONT statusbarFont; + DWORD initWindows(char **errmsg) { STARTUPINFOW si; + NONCLIENTMETRICSW ncm; /* WinMain() parameters */ hInstance = GetModuleHandleW(NULL); @@ -35,5 +42,24 @@ DWORD initWindows(char **errmsg) return GetLastError(); } + /* standard fonts */ +#define GETFONT(l, f, n) l = CreateFontIndirectW(&ncm.f); \ + if (l == NULL) { \ + *errmsg = "error loading " n " font"; \ + return GetLastError(); \ + } + + ZeroMemory(&ncm, sizeof (NONCLIENTMETRICSW)); + ncm.cbSize = sizeof (NONCLIENTMETRICSW); + if (SystemParametersInfoW(SPI_GETNONCLIENTMETRICS, sizeof (NONCLIENTMETRICSW), &ncm, sizeof (NONCLIENTMETRICSW)) == 0) { + *errmsg = "error getting non-client metrics parameters"; + return GetLastError(); + } + GETFONT(controlFont, lfMessageFont, "control"); + GETFONT(titleFont, lfCaptionFont, "titlebar"); + GETFONT(smallTitleFont, lfSmCaptionFont, "small title bar"); + GETFONT(menubarFont, lfMenuFont, "menu bar"); + GETFONT(statusbarFont, lfStatusFont, "status bar"); + return 0; } |
