diff options
author | John Ankarström <john@ankarstrom.se> | 2022-08-15 22:17:16 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2022-08-15 22:17:16 +0200 |
commit | 1eb7d7013902dc8bbb7b84dc05e0dda4c2243c4f (patch) | |
tree | d770b3e15cf356a5eb6acc80e007297308fdafc3 /c | |
parent | 16c355664bf27e5ec4be5e58bd83d9d1a4752a20 (diff) | |
download | EpisodeBrowser-1eb7d7013902dc8bbb7b84dc05e0dda4c2243c4f.tar.gz |
Fix bug...
If with init-statement makes me sad, because it is very confusing.
Diffstat (limited to 'c')
-rw-r--r-- | c/main.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -180,12 +180,12 @@ void InitializeMainWindow(const HWND hWnd) /* Look up DPI. */ if (auto lib = Library::Maybe(L"User32.dll"); - auto GetDpiForWindow = lib->GetProcAddress<UINT(HWND)>("GetDpiForWindow")) + auto GetDpiForWindow = lib? lib->GetProcAddress<UINT(HWND)>("GetDpiForWindow"): nullptr) g_dpi = GetDpiForWindow(hWnd); /* Load normal font. */ if (auto lib = Library::Maybe(L"User32.dll"); - lib->GetProcAddress<void>("SystemParametersInfoW")) { + lib && lib->GetProcAddress<void>("SystemParametersInfoW")) { NONCLIENTMETRICS m = {sizeof(NONCLIENTMETRICS)}; Require(SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS), &m, 0)); g_hfNormal = Require(CreateFontIndirect(&m.lfMessageFont)); |