From aac409bdd73fd96d256f87285a7c9b959d2117b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Tue, 19 Jul 2022 14:12:20 +0200 Subject: Remove EBMessageBoxA. --- c/common.cpp | 15 ++------------- c/common.h | 1 - 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/c/common.cpp b/c/common.cpp index 2259b69..494c382 100644 --- a/c/common.cpp +++ b/c/common.cpp @@ -86,19 +86,8 @@ int EBMessageBox(const TCHAR* const tszText, const TCHAR* const tszCaption, cons extern HWND g_hWnd; HHOOK hHook = SetWindowsHookEx(WH_CBT, CBTProc, 0, GetCurrentThreadId()); if (!hHook) return 0; - MessageBox(g_hWnd, tszText, tszCaption, uType); + int r = MessageBox(g_hWnd, tszText, tszCaption, uType); UnhookWindowsHookEx(hHook); if (!hHook) throw Win32Error(GetLastError()); - return 0; -} - -int EBMessageBoxA(const char* const szText, const char* const szCaption, const unsigned uType) -{ - extern HWND g_hWnd; - HHOOK hHook = SetWindowsHookEx(WH_CBT, CBTProc, 0, GetCurrentThreadId()); - if (!hHook) return 0; - MessageBoxA(g_hWnd, szText, szCaption, uType); - UnhookWindowsHookEx(hHook); - if (!hHook) throw Win32Error(GetLastError()); - return 0; + return r; } diff --git a/c/common.h b/c/common.h index 9d14b1d..bffc9e5 100644 --- a/c/common.h +++ b/c/common.h @@ -12,7 +12,6 @@ #endif int EBMessageBox(const TCHAR* tszText, const TCHAR* tszCaption, unsigned uType); -int EBMessageBoxA(const char* szText, const char* szCaption, unsigned uType); struct Win32Error : public std::exception { -- cgit v1.2.3