diff options
author | John Ankarström <john@ankarstrom.se> | 2022-08-26 03:17:09 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2022-08-26 03:17:09 +0200 |
commit | eb7709d8617bec27349eebb43e8941b3aaaf453e (patch) | |
tree | 7c8627586ed18132b0304b779a00d8acc61e7a0d /c/win.cpp | |
parent | a9a74875dbd5340b6f3ea6d8b6f66a04b360b22a (diff) | |
download | EpisodeBrowser-eb7709d8617bec27349eebb43e8941b3aaaf453e.tar.gz |
Use FunctionW names explicitly instead of macros.
It's uglier, but it makes Visual Studio show better tooltips.
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(); } |