From ac7d676a1c457f71f1d3ae17d74699dd95c9c985 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Wed, 7 Sep 2022 01:22:30 +0200 Subject: Normalize error message formatting. --- 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 73316e8..e1053a3 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: %s."); 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: %s."); 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: %s."); } /* 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: %s."); 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: %s."); } 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: %s."); } Library::~Library() -- cgit v1.2.3