From 6bcd75ef3fb6786955938019c1eb8a6950e3063e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Thu, 11 Aug 2022 23:14:33 +0200 Subject: EBMessageBox: Take wstring_view instead of wchar_t*. --- c/win.cpp | 4 ++-- c/win.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'c') diff --git a/c/win.cpp b/c/win.cpp index 97e85a4..95ec9a7 100644 --- a/c/win.cpp +++ b/c/win.cpp @@ -70,11 +70,11 @@ static void CenterNextWindow(HWND hWnd) }, nullptr, GetCurrentThreadId())); } -int EBMessageBox(const wchar_t* const wszText, const wchar_t* const wszCaption, const UINT uType) +int EBMessageBox(const std::wstring_view text, const std::wstring_view caption, const UINT uType) { extern HWND g_hWnd; CenterNextWindow(g_hWnd); - return MessageBox(g_hWnd, wszText, wszCaption, uType); + return MessageBox(g_hWnd, text.data(), caption.data(), uType); } int GetRelativeCursorPos(const HWND hWnd, POINT* const pt) noexcept diff --git a/c/win.h b/c/win.h index 30d3cc5..e9a6839 100644 --- a/c/win.h +++ b/c/win.h @@ -7,7 +7,7 @@ /* Run given procedure at creation of next window. */ void WithNextWindow(void (*proc)(HWND)); /* Display message box centered in main window. */ -int EBMessageBox(const wchar_t* wszText, const wchar_t* wszCaption, UINT uType); +int EBMessageBox(std::wstring_view text, std::wstring_view data, UINT uType); /* Retrieve mouse position relative to given window's client area. */ int GetRelativeCursorPos(HWND hWnd, POINT* pt) noexcept; /* Cached values from GetSystemMetrics. */ -- cgit v1.2.3