diff options
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)); |