From b5917be252caf9d38ae9466352c4176ef25732e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Wed, 7 Sep 2022 23:33:08 +0200 Subject: Simplify Err message format. --- c/win32.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'c/win32.cpp') diff --git a/c/win32.cpp b/c/win32.cpp index e1053a3..83488d4 100644 --- a/c/win32.cpp +++ b/c/win32.cpp @@ -17,7 +17,7 @@ std::wstring WideFromNarrow(const std::string_view src, const int cp) int cchWide = MultiByteToWideChar(cp, 0, src.data(), cchNarrow, nullptr, 0); std::wstring dst(cchWide, 0); if (!MultiByteToWideChar(cp, 0, src.data(), cchNarrow, dst.data(), cchWide)) - throw Err(WINDOWS, L"Narrow string could not be converted to wide string: %s."); + throw Err(WINDOWS, L"Narrow string could not be converted to wide string"); return dst; } @@ -37,7 +37,7 @@ void WithNextWindow(void (*proc)(HWND)) { if (nCode == HCBT_CREATEWND) { if (!UnhookWindowsHookEx(hHook)) - throw Err(WINDOWS, L"Window hook could not be removed: %s."); + throw Err(WINDOWS, L"Window hook could not be removed"); procNext(reinterpret_cast(wParam)); return 0; } else @@ -46,7 +46,7 @@ void WithNextWindow(void (*proc)(HWND)) procNext = proc; if (!(hHook = SetWindowsHookExW(WH_CBT, procCBT, nullptr, GetCurrentThreadId()))) - throw Err(WINDOWS, L"Window hook could not be set: %s."); + throw Err(WINDOWS, L"Window hook could not be set"); } /* Display next created window in the center of given window. */ @@ -72,7 +72,7 @@ static void CenterNextWindow(HWND hWnd) } else if (nCode == HCBT_ACTIVATE && reinterpret_cast(wParam) == hWndNext) { if (!UnhookWindowsHookEx(hHook)) - throw Err(WINDOWS, L"Window hook could not be removed: %s."); + throw Err(WINDOWS, L"Window hook could not be removed"); long lStyle = GetWindowLongW(hWndNext, GWL_STYLE); if (!(lStyle & WS_POPUP)) return 0; @@ -94,7 +94,7 @@ static void CenterNextWindow(HWND hWnd) hWndParent = hWnd; hWndNext = nullptr; if (!(hHook = SetWindowsHookExW(WH_CBT, procCBT, nullptr, GetCurrentThreadId()))) - throw Err(WINDOWS, L"Window hook could not be set: %s."); + throw Err(WINDOWS, L"Window hook could not be set"); } int EBMessageBox(const std::wstring_view text, const std::wstring_view caption, const UINT uType) @@ -133,7 +133,7 @@ Library::Library(const wchar_t* const lib) { m_hModule = LoadLibraryW(lib); if (!m_hModule) - throw Err(WINDOWS, L"Library "s + lib + L" could not be loaded: %s."); + throw Err(WINDOWS, L"Library "s + lib + L" could not be loaded"); } Library::~Library() -- cgit v1.2.3