aboutsummaryrefslogtreecommitdiff
path: root/c/win32.h
diff options
context:
space:
mode:
Diffstat (limited to 'c/win32.h')
-rw-r--r--c/win32.h15
1 files changed, 4 insertions, 11 deletions
diff --git a/c/win32.h b/c/win32.h
index a88e97c..c18e70f 100644
--- a/c/win32.h
+++ b/c/win32.h
@@ -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;
}