diff options
Diffstat (limited to 'c/win32.h')
-rw-r--r-- | c/win32.h | 15 |
1 files changed, 4 insertions, 11 deletions
@@ -6,6 +6,8 @@ #include <windows.h> #include <commctrl.h> +#include "err.h" + /* Convert narrow to wide string. */ std::wstring WideFromNarrow(const std::string_view src, const int cp = CP_UTF8); @@ -13,16 +15,7 @@ std::wstring WideFromNarrow(const std::string_view src, const int cp = CP_UTF8); void WithNextWindow(void (*proc)(HWND)); /* Display message box centered in main window. */ -int EBMessageBox(std::wstring_view text, std::wstring_view data, UINT uType); - -/* Specify current action (used by ShowException). */ -void Act(const wchar_t* action); - -/* Show message box for current exception. */ -void ShowException( - const wchar_t* fmt = L"An error occurred: %s", - const wchar_t* title = L"Error", - UINT uType = MB_ICONWARNING) noexcept; +int EBMessageBox(std::wstring_view text, std::wstring_view data, UINT uType = MB_ICONWARNING); /* Retrieve mouse position relative to given window's client area. */ int GetRelativeCursorPos(HWND hWnd, POINT* pt) noexcept; @@ -89,7 +82,7 @@ T* Library::GetProcAddress(const char* const szProc) noexcept template <typename T> inline T Require(const T x) { - if (!x) throw Win32Error(); + if (!x) Err(WINDOWS, L"System error: %s"); return x; } |