aboutsummaryrefslogtreecommitdiff
path: root/c/main.cpp
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2022-08-02 23:31:21 +0200
committerJohn Ankarström <john@ankarstrom.se>2022-08-02 23:31:21 +0200
commitedce20642b6d177ee9877775cbfa9e05ebb4e404 (patch)
treef37c2d7121b3de0491561a5bd33ecf004d3a67d2 /c/main.cpp
parentad4a1e4ac6b9452bb28936623035d01bb03f36f2 (diff)
downloadEpisodeBrowser-edce20642b6d177ee9877775cbfa9e05ebb4e404.tar.gz
Replace maybe_make.
It seems unnecessary to throw exceptions when simply checking whether a library exists.
Diffstat (limited to 'c/main.cpp')
-rw-r--r--c/main.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/c/main.cpp b/c/main.cpp
index d76225e..32187c8 100644
--- a/c/main.cpp
+++ b/c/main.cpp
@@ -1,4 +1,5 @@
#include <exception>
+#include <stdexcept>
#include <windows.h>
#include <commctrl.h>
#include <uxtheme.h>
@@ -165,16 +166,16 @@ static LRESULT CALLBACK CBTProc(const int nCode, const WPARAM wParam, const LPAR
g_hWnd = (HWND)wParam;
/* Look up constants. */
- if (auto lib = maybe_make<Library>(L"User32.dll");
+ if (auto lib = Library::Maybe(L"User32.dll");
auto GetDpiForWindow = lib->GetProcAddress<UINT(HWND)>("GetDpiForWindow"))
g_dpi = GetDpiForWindow(g_hWnd);
- if (auto lib = maybe_make<Library>(L"uxtheme.dll");
+ if (auto lib = Library::Maybe(L"uxtheme.dll");
lib->GetProcAddress<void>("SetWindowTheme"))
g_bThemes = 1;
- if (auto lib = maybe_make<Library>(L"User32.dll");
- lib->GetProcAddress<void>("SystemParametersInfo" WA)) {
+ if (auto lib = Library::Maybe(L"User32.dll");
+ lib->GetProcAddress<void>("SystemParametersInfoW")) {
NONCLIENTMETRICS m;
m.cbSize = sizeof(NONCLIENTMETRICS);
require(SystemParametersInfo(SPI_GETNONCLIENTMETRICS,