diff options
Diffstat (limited to 'c/win.cpp')
-rw-r--r-- | c/win.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -27,7 +27,7 @@ void WithNextWindow(void (*proc)(HWND)) * accept a capturing lambda as the hook procedure. */ static thread_local auto procNext = proc; - static thread_local HHOOK hHook = Require(SetWindowsHookEx(WH_CBT, [](const int nCode, + static thread_local HHOOK hHook = Require(SetWindowsHookExW(WH_CBT, [](const int nCode, const WPARAM wParam, const LPARAM lParam) -> LRESULT CALLBACK { if (nCode == HCBT_CREATEWND) { @@ -56,7 +56,7 @@ static void CenterNextWindow(HWND hWnd) hWndParent = hWnd; hWndNext = nullptr; - hHook = Require(SetWindowsHookEx(WH_CBT, [](const int nCode, + hHook = Require(SetWindowsHookExW(WH_CBT, [](const int nCode, const WPARAM wParam, const LPARAM lParam) noexcept -> LRESULT CALLBACK { if (!hWndNext && nCode == HCBT_CREATEWND) { @@ -66,7 +66,7 @@ static void CenterNextWindow(HWND hWnd) && reinterpret_cast<HWND>(wParam) == hWndNext) { Require(UnhookWindowsHookEx(hHook)); - long lStyle = GetWindowLong(hWndNext, GWL_STYLE); + long lStyle = GetWindowLongW(hWndNext, GWL_STYLE); if (!(lStyle & WS_POPUP)) return 0; RECT rcMain, rcMsg; @@ -156,7 +156,7 @@ const char* Win32Error::what() const noexcept const wchar_t* Win32Error::What() const noexcept { if (!m_wszMsg) - FormatMessage( + FormatMessageW( FORMAT_MESSAGE_ALLOCATE_BUFFER |FORMAT_MESSAGE_FROM_SYSTEM |FORMAT_MESSAGE_FROM_HMODULE @@ -184,7 +184,7 @@ InternetError::InternetError(DWORD codeSystem) cch = len+1; m_wszMsg = new wchar_t[cch]; - if (!InternetGetLastResponseInfo(&code, m_wszMsg, &len)) + if (!InternetGetLastResponseInfoW(&code, m_wszMsg, &len)) throw Win32Error(); } @@ -206,7 +206,7 @@ const wchar_t* InternetError::What() const noexcept std::optional<Library> Library::Maybe(const wchar_t* const lib) noexcept { - HMODULE hModule = LoadLibrary(lib); + HMODULE hModule = LoadLibraryW(lib); if (!hModule) return {}; return Library(hModule); } @@ -216,7 +216,7 @@ Library::Library(const HMODULE hModule) noexcept Library::Library(const wchar_t* const lib) { - m_hModule = LoadLibrary(lib); + m_hModule = LoadLibraryW(lib); if (!m_hModule) throw Win32Error(); } |