diff options
Diffstat (limited to 'c/window.h')
-rw-r--r-- | c/window.h | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -15,7 +15,15 @@ struct Window HWND hWnd; HWND hWndFocus = nullptr; HWND hWndStatus = nullptr; - HMENU hMenuPopup = Require(GetSubMenu(Require(LoadMenuW(nullptr, MAKEINTRESOURCE(IDR_POPUPMENU))), 0)); + const HMENU hMenuPopup = []() + { + HMENU hm; + if (!(hm = LoadMenuW(nullptr, MAKEINTRESOURCE(IDR_POPUPMENU)))) + throw Err(WINDOWS, L"Context menu could not be loaded: %s"); + if (!GetSubMenu(hm, 0)) + throw Err(WINDOWS, L"Submenu could not be retrieved: %s"); + return hm; + }(); /* File views. */ FileView<CfgA> fvCfg = FileView<CfgA>::Initialized(L"cfg.dat", 1); |